Class: Arke::Resource::Associations::HasManyAssociation
- Inherits:
-
Base
- Object
- Base
- Arke::Resource::Associations::HasManyAssociation
show all
- Includes:
- Enumerable
- Defined in:
- lib/arke/resource/associations/has_many_association.rb
Instance Attribute Summary
Attributes inherited from Base
#name, #options
Instance Method Summary
collapse
Methods inherited from Base
#initialize, #target
Instance Method Details
#all(params = {}) ⇒ Object
9
10
11
12
13
|
# File 'lib/arke/resource/associations/has_many_association.rb', line 9
def all(params={})
target.all(params.merge({
template: "/#{@parent.class.table_name}/#{@parent.send(options[:foreign_key] || :id)}/{endpoint}"
}))
end
|
#count(params = {}) ⇒ Object
19
20
21
|
# File 'lib/arke/resource/associations/has_many_association.rb', line 19
def count(params={})
all(params).count
end
|
#each(&block) ⇒ Object
15
16
17
|
# File 'lib/arke/resource/associations/has_many_association.rb', line 15
def each(&block)
self.all.each &block
end
|