Class: Orchestra::DSL::ObjectContext

Inherits:
Object
  • Object
show all
Defined in:
lib/orchestra/dsl/object_adapter.rb

Instance Method Summary collapse

Constructor Details

#initialize(adapter, state) ⇒ ObjectContext

Returns a new instance of ObjectContext.



127
128
129
130
131
132
133
134
# File 'lib/orchestra/dsl/object_adapter.rb', line 127

def initialize adapter, state
  @__adapter__ = adapter
  @__state__ = state
  return unless adapter.collection?
  self.singleton_class.send :define_method, :fetch_collection do
    @__state__.fetch adapter.collection
  end
end

Instance Method Details

#execute(*args) ⇒ Object



136
137
138
# File 'lib/orchestra/dsl/object_adapter.rb', line 136

def execute *args
  @__adapter__.execute @__state__, *args
end