Class: CanTango::Configuration::Models::Actions

Inherits:
Object
  • Object
show all
Defined in:
lib/cantango/config/models/actions.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeActions

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

#collectionObject (readonly)

Returns the value of attribute collection.



5
6
7
# File 'lib/cantango/config/models/actions.rb', line 5

def collection
  @collection
end

#memberObject (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