Class: Triggerino::ActionList
- Inherits:
-
Object
- Object
- Triggerino::ActionList
- Extended by:
- Forwardable
- Includes:
- Enumerable, Observable
- Defined in:
- lib/triggerino/action_list.rb
Instance Attribute Summary collapse
-
#selected ⇒ Object
Returns the value of attribute selected.
Instance Method Summary collapse
-
#initialize(observer, *actions) ⇒ ActionList
constructor
A new instance of ActionList.
- #select_next ⇒ Object
Constructor Details
#initialize(observer, *actions) ⇒ ActionList
Returns a new instance of ActionList.
14 15 16 17 18 19 |
# File 'lib/triggerino/action_list.rb', line 14 def initialize observer, *actions @actions = actions @selected = @actions.first add_observer observer notify_changed end |
Instance Attribute Details
#selected ⇒ Object
Returns the value of attribute selected.
12 13 14 |
# File 'lib/triggerino/action_list.rb', line 12 def selected @selected end |
Instance Method Details
#select_next ⇒ Object
21 22 23 24 |
# File 'lib/triggerino/action_list.rb', line 21 def select_next @selected = @actions[selected_index + 1] || @actions.first notify_changed end |