Class: Notifications::ActionList
- Inherits:
-
Object
- Object
- Notifications::ActionList
- Defined in:
- lib/notifications.rb
Instance Method Summary collapse
- #<<(action) ⇒ Object
- #[](id) ⇒ Object
-
#initialize(action_list = []) ⇒ ActionList
constructor
A new instance of ActionList.
- #length ⇒ Object
- #pack ⇒ Object
Constructor Details
#initialize(action_list = []) ⇒ ActionList
Returns a new instance of ActionList.
145 146 147 |
# File 'lib/notifications.rb', line 145 def initialize(action_list = []) @action_list = action_list end |
Instance Method Details
#<<(action) ⇒ Object
149 150 151 |
# File 'lib/notifications.rb', line 149 def <<(action) @action_list << action end |
#[](id) ⇒ Object
153 154 155 |
# File 'lib/notifications.rb', line 153 def [](id) @action_list[id] end |
#length ⇒ Object
157 158 159 |
# File 'lib/notifications.rb', line 157 def length @action_list.length end |
#pack ⇒ Object
161 162 163 164 165 166 167 168 |
# File 'lib/notifications.rb', line 161 def pack al = @action_list.map do |action| action.normalize end al.flatten! al end |