Class: Opensteam::StateMachine::Observer

Inherits:
Object
  • Object
show all
Defined in:
lib/opensteam/state_machine.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(receiver, &block) ⇒ Observer

Returns a new instance of Observer.



85
86
87
88
# File 'lib/opensteam/state_machine.rb', line 85

def initialize( receiver, &block )
  @receiver = receiver
  @code = block
end

Instance Attribute Details

#codeObject

Returns the value of attribute code.



83
84
85
# File 'lib/opensteam/state_machine.rb', line 83

def code
  @code
end

#receiverObject

Returns the value of attribute receiver.



83
84
85
# File 'lib/opensteam/state_machine.rb', line 83

def receiver
  @receiver
end

Instance Method Details

#exc(instance) ⇒ Object



90
91
92
93
# File 'lib/opensteam/state_machine.rb', line 90

def exc( instance )
  @code.call( instance )
  #        @code.bind( instance ).call
end