module Signal def self.call Call end module Call def self.included(target) target.include(Signal) target.extend(ClassMethods) end module ClassMethods def call(*args, &block) new(*args).tap do |instance| yield(instance) instance.call end end end end end