Sha256: 70793bcbbaf6557252021c6938054133a6577af38f7d8a36e082e653d9637005

Contents?: true

Size: 417 Bytes

Versions: 1

Compression:

Stored size: 417 Bytes

Contents

module Signal
  def self.call
    Extensions::Call
  end

  module Extensions
    module Call
      def self.included(target)
        target.include(Signal)
        target.extend(ClassMethods)
      end

      module ClassMethods
        def call(*args)
          new(*args).tap do |instance|
            yield(instance) if block_given?
            instance.call
          end
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
signal-1.1.0 lib/signal/extensions/call.rb