Class: Obake::State
- Inherits:
-
Object
- Object
- Obake::State
- Defined in:
- lib/obake/state.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
Returns the value of attribute id.
Instance Method Summary collapse
- #exit(next_state_id, data = {}) ⇒ Object
-
#initialize(id) ⇒ State
constructor
A new instance of State.
- #on_enter(data) ⇒ Object
- #on_exit ⇒ Object
Constructor Details
#initialize(id) ⇒ State
Returns a new instance of State.
5 6 7 |
# File 'lib/obake/state.rb', line 5 def initialize(id) @id = id end |
Instance Attribute Details
#id ⇒ Object
Returns the value of attribute id.
3 4 5 |
# File 'lib/obake/state.rb', line 3 def id @id end |
Instance Method Details
#exit(next_state_id, data = {}) ⇒ Object
17 18 19 |
# File 'lib/obake/state.rb', line 17 def exit(next_state_id, data = {}) @fsm.change_state(Transition.new(next_state_id, data)) end |
#on_enter(data) ⇒ Object
9 10 11 |
# File 'lib/obake/state.rb', line 9 def on_enter(data) end |
#on_exit ⇒ Object
13 14 15 |
# File 'lib/obake/state.rb', line 13 def on_exit end |