Class: Stateflow::Machine
- Inherits:
-
Object
- Object
- Stateflow::Machine
- Defined in:
- lib/stateflow/machine.rb
Instance Attribute Summary collapse
-
#events ⇒ Object
Returns the value of attribute events.
-
#initial_state ⇒ Object
Returns the value of attribute initial_state.
-
#states ⇒ Object
Returns the value of attribute states.
Instance Method Summary collapse
-
#initialize(&machine) ⇒ Machine
constructor
A new instance of Machine.
- #state_column(name = :state) ⇒ Object
Constructor Details
#initialize(&machine) ⇒ Machine
Returns a new instance of Machine.
5 6 7 8 |
# File 'lib/stateflow/machine.rb', line 5 def initialize(&machine) @states, @events = Hash.new, Hash.new instance_eval(&machine) end |
Instance Attribute Details
#events ⇒ Object
Returns the value of attribute events.
3 4 5 |
# File 'lib/stateflow/machine.rb', line 3 def events @events end |
#initial_state ⇒ Object
Returns the value of attribute initial_state.
3 4 5 |
# File 'lib/stateflow/machine.rb', line 3 def initial_state @initial_state end |
#states ⇒ Object
Returns the value of attribute states.
3 4 5 |
# File 'lib/stateflow/machine.rb', line 3 def states @states end |
Instance Method Details
#state_column(name = :state) ⇒ Object
10 11 12 |
# File 'lib/stateflow/machine.rb', line 10 def state_column(name = :state) @state_column ||= name end |