class StateManager::State::Specification

Represents the static specification of this state. This consists of all child states and events. During initialization, the specification will be read and the child states and events will be initialized.

Attributes

events[RW]
initial_state[RW]
states[RW]

Public Class Methods

new() click to toggle source
# File lib/state_manager/state.rb, line 12
def initialize
  self.states = {}
  self.events = {}
end

Public Instance Methods

descendant_names() click to toggle source
# File lib/state_manager/state.rb, line 22
def descendant_names
  res = []
  states.each do |state, specification_klass|
    res << state
    res.concat specification_klass.specification.descendant_names.map{|s| "#{state}.#{s}"}
  end
  res
end
initialize_copy(source) click to toggle source
# File lib/state_manager/state.rb, line 17
def initialize_copy(source)
  self.states = source.states.dup
  self.events = source.events.dup
end