Class: Objectify::Executor

Inherits:
Object
  • Object
show all
Includes:
Instrumentation
Defined in:
lib/objectify/executor.rb

Instance Method Summary collapse

Constructor Details

#initialize(injector, instantiator) ⇒ Executor

Returns a new instance of Executor.



7
8
9
10
# File 'lib/objectify/executor.rb', line 7

def initialize(injector, instantiator)
  @injector = injector
  @instantiator = instantiator
end

Instance Method Details

#call(name, type) ⇒ Object



12
13
14
15
16
17
18
19
# File 'lib/objectify/executor.rb', line 12

def call(name, type)
  method = type == :policy ? :allowed? : :call
  opts = { :name => name, :type => type }
  instrument("executor_start.objectify", opts)
  instrument("executor.objectify", opts) do
    @injector.call(@instantiator.call(name, type), method)
  end
end