Class: Gameplan::Transitions
- Inherits:
-
Array
- Object
- Array
- Gameplan::Transitions
- Defined in:
- lib/gameplan/transitions.rb
Instance Method Summary collapse
- #add(state_name, transition_name) ⇒ Object
- #emit ⇒ Object
-
#initialize(yielder) ⇒ Transitions
constructor
A new instance of Transitions.
Constructor Details
#initialize(yielder) ⇒ Transitions
Returns a new instance of Transitions.
3 4 5 |
# File 'lib/gameplan/transitions.rb', line 3 def initialize(yielder) @yielder = yielder end |
Instance Method Details
#add(state_name, transition_name) ⇒ Object
11 12 13 14 15 16 17 18 |
# File 'lib/gameplan/transitions.rb', line 11 def add(state_name, transition_name) begin self << [state_name, transition_name] yield ensure pop end end |
#emit ⇒ Object
7 8 9 |
# File 'lib/gameplan/transitions.rb', line 7 def emit @yielder << self.dup end |