Class: EngagingNetworks::Response::Collection
- Inherits:
-
Object
- Object
- EngagingNetworks::Response::Collection
- Includes:
- Enumerable
- Defined in:
- lib/engaging_networks/response/collection.rb
Instance Attribute Summary collapse
-
#objects ⇒ Object
readonly
Returns the value of attribute objects.
Instance Method Summary collapse
- #each(&block) ⇒ Object
-
#initialize(data) ⇒ Collection
constructor
A new instance of Collection.
Constructor Details
#initialize(data) ⇒ Collection
Returns a new instance of Collection.
10 11 12 13 14 |
# File 'lib/engaging_networks/response/collection.rb', line 10 def initialize(data) @objects = data.inject([]) do |arr, row| arr << EngagingNetworks::Response::Object.new(row) end end |
Instance Attribute Details
#objects ⇒ Object (readonly)
Returns the value of attribute objects.
8 9 10 |
# File 'lib/engaging_networks/response/collection.rb', line 8 def objects @objects end |
Instance Method Details
#each(&block) ⇒ Object
16 17 18 19 20 |
# File 'lib/engaging_networks/response/collection.rb', line 16 def each(&block) @objects.each do |o| block.call(o) end end |