Class: Statemachine::SuperstateBuilder
- Includes:
- StateBuilding, SuperstateBuilding
- Defined in:
- lib/statemachine/builder.rb
Overview
Builder class used to define superstates. Creates by SuperstateBuilding#superstate
Instance Attribute Summary
Attributes included from SuperstateBuilding
Attributes included from StateBuilding
Attributes inherited from Builder
Instance Method Summary collapse
-
#initialize(id, superstate, statemachine) ⇒ SuperstateBuilder
constructor
A new instance of SuperstateBuilder.
Methods included from SuperstateBuilding
#default_history, #on_entry_of, #on_exit_of, #startstate, #state, #superstate, #trans, #transition_from
Methods included from StateBuilding
#default, #event, #on_entry, #on_event, #on_exit
Constructor Details
#initialize(id, superstate, statemachine) ⇒ SuperstateBuilder
Returns a new instance of SuperstateBuilder.
236 237 238 239 240 241 |
# File 'lib/statemachine/builder.rb', line 236 def initialize(id, superstate, statemachine) super statemachine @subject = Superstate.new(id, superstate, statemachine) superstate.startstate_id = id if superstate.startstate_id == nil statemachine.add_state(@subject) end |