Class: SimpleFSM::TransitionFactory
- Inherits:
-
Object
- Object
- SimpleFSM::TransitionFactory
- Defined in:
- lib/simplefsm.rb
Overview
TransitionFactory instance is a temporary helper object for making transitions from a transitions_for code block parameter
Instance Method Summary collapse
- #event(ev, args) ⇒ Object
-
#initialize ⇒ TransitionFactory
constructor
A new instance of TransitionFactory.
- #transitions ⇒ Object
Constructor Details
#initialize ⇒ TransitionFactory
22 23 24 |
# File 'lib/simplefsm.rb', line 22 def initialize @transitions = [] end |
Instance Method Details
#event(ev, args) ⇒ Object
26 27 28 29 |
# File 'lib/simplefsm.rb', line 26 def event ev, args t = {:event => ev}.merge!(args) @transitions << t end |
#transitions ⇒ Object
31 32 33 |
# File 'lib/simplefsm.rb', line 31 def transitions @transitions end |