Module: Mandate::CallInjector

Defined in:
lib/mandate/call_injector.rb

Class Method Summary collapse

Class Method Details

.extended(base) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
# File 'lib/mandate/call_injector.rb', line 3

def self.extended(base)
  # Defining call allows us to do use the syntax:
  #   Foobar.(some, args)
  # which internally calls:
  #   Foobar.new(some, args).call()
  class << base
    def call(...)
      new(...).()
    end
  end
end