Class: Layer::ResourceCollection
- Inherits:
-
Enumerator
- Object
- Enumerator
- Layer::ResourceCollection
- Defined in:
- lib/layer/resource_collection.rb
Instance Method Summary collapse
-
#initialize(resource, client) ⇒ ResourceCollection
constructor
A new instance of ResourceCollection.
Constructor Details
#initialize(resource, client) ⇒ ResourceCollection
Returns a new instance of ResourceCollection.
4 5 6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/layer/resource_collection.rb', line 4 def initialize(resource, client) @resource = resource @client = client @params = { page_size: 100 } super() do |yielder| while response = next_page response.map do |attributes| yielder << resource.from_response(attributes, client) end end end end |