Class: Opensteam::StateMachine::Observer
- Inherits:
-
Object
- Object
- Opensteam::StateMachine::Observer
- Defined in:
- lib/opensteam/state_machine.rb
Instance Attribute Summary collapse
-
#code ⇒ Object
Returns the value of attribute code.
-
#receiver ⇒ Object
Returns the value of attribute receiver.
Instance Method Summary collapse
- #exc(instance) ⇒ Object
-
#initialize(receiver, &block) ⇒ Observer
constructor
A new instance of Observer.
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
#code ⇒ Object
Returns the value of attribute code.
83 84 85 |
# File 'lib/opensteam/state_machine.rb', line 83 def code @code end |
#receiver ⇒ Object
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 |