Class: Pakyow::Application::Behavior::Operations::Lookup

Inherits:
Object
  • Object
show all
Defined in:
lib/pakyow/application/behavior/operations.rb

Instance Method Summary collapse

Constructor Details

#initialize(operations:, app:) ⇒ Lookup

Returns a new instance of Lookup.



14
15
16
17
18
19
20
# File 'lib/pakyow/application/behavior/operations.rb', line 14

def initialize(operations:, app:)
  operations.each do |operation|
    define_singleton_method operation.__object_name.name do |values = {}, &block|
      (block ? Class.new(operation, &block) : operation).new(app: app, **values).perform
    end
  end
end