Class: Pexels::CollectionSet
- Inherits:
-
PaginatedResponse
- Object
- PaginatedResponse
- Pexels::CollectionSet
- Defined in:
- lib/pexels/collection_set.rb
Instance Attribute Summary
Attributes inherited from PaginatedResponse
#page, #per_page, #total_results
Instance Method Summary collapse
-
#initialize(response) ⇒ CollectionSet
constructor
A new instance of CollectionSet.
Methods inherited from PaginatedResponse
#each, #next_page, #prev_page, #total_pages
Constructor Details
#initialize(response) ⇒ CollectionSet
Returns a new instance of CollectionSet.
6 7 8 9 |
# File 'lib/pexels/collection_set.rb', line 6 def initialize(response) super @data = attrs.fetch('collections', []).map { |attrs| Pexels::Collection.new(attrs) } end |