Class: StateManager::State::Specification

Inherits:
Object
  • Object
show all
Defined in:
lib/state_manager/state.rb

Overview

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.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize ⇒ Specification

Returns a new instance of Specification.



12
13
14
15
# File 'lib/state_manager/state.rb', line 12

def initialize
  self.states = {}
  self.events = {}
end

Instance Attribute Details

#events ⇒ Object

Returns the value of attribute events.



10
11
12
# File 'lib/state_manager/state.rb', line 10

def events
  @events
end

#initial_state ⇒ Object

Returns the value of attribute initial_state.



10
11
12
# File 'lib/state_manager/state.rb', line 10

def initial_state
  @initial_state
end

#states ⇒ Object

Returns the value of attribute states.



10
11
12
# File 'lib/state_manager/state.rb', line 10

def states
  @states
end

Instance Method Details

#initialize_copy(source) ⇒ Object



17
18
19
20
# File 'lib/state_manager/state.rb', line 17

def initialize_copy(source)
  self.states = source.states.dup
  self.events = source.events.dup
end