Class: CanTango::Configuration::Models::Actions
- Inherits:
-
Object
- Object
- CanTango::Configuration::Models::Actions
- Defined in:
- lib/cantango/config/models/actions.rb
Instance Attribute Summary collapse
-
#collection ⇒ Object
readonly
Returns the value of attribute collection.
-
#member ⇒ Object
readonly
Returns the value of attribute member.
Instance Method Summary collapse
- #actions_for(type) ⇒ Object
- #add_collection(action) ⇒ Object
- #add_member(action) ⇒ Object
-
#initialize ⇒ Actions
constructor
A new instance of Actions.
Constructor Details
#initialize ⇒ Actions
Returns a new instance of Actions.
7 8 9 10 |
# File 'lib/cantango/config/models/actions.rb', line 7 def initialize @collection = [] @member = [] end |
Instance Attribute Details
#collection ⇒ Object (readonly)
Returns the value of attribute collection.
5 6 7 |
# File 'lib/cantango/config/models/actions.rb', line 5 def collection @collection end |
#member ⇒ Object (readonly)
Returns the value of attribute member.
5 6 7 |
# File 'lib/cantango/config/models/actions.rb', line 5 def member @member end |
Instance Method Details
#actions_for(type) ⇒ Object
12 13 14 |
# File 'lib/cantango/config/models/actions.rb', line 12 def actions_for type send(type.to_sym) || [] end |
#add_collection(action) ⇒ Object
20 21 22 |
# File 'lib/cantango/config/models/actions.rb', line 20 def add_collection action @collection << action.to_sym end |
#add_member(action) ⇒ Object
16 17 18 |
# File 'lib/cantango/config/models/actions.rb', line 16 def add_member action @member << action.to_sym end |