Class: Statemachine::SuperstateBuilder

Inherits:
Builder
  • Object
show all
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

#subject

Attributes included from StateBuilding

#subject

Attributes inherited from Builder

#statemachine

Instance Method Summary collapse

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