Class: Homeflow::API::Collection
- Inherits:
-
Array
- Object
- Array
- Homeflow::API::Collection
- Defined in:
- lib/homeflow/api/collection.rb
Instance Method Summary collapse
- #has_next_page? ⇒ Boolean
-
#initialize(collection_response, klass) ⇒ Collection
constructor
A new instance of Collection.
- #total ⇒ Object
Constructor Details
#initialize(collection_response, klass) ⇒ Collection
Returns a new instance of Collection.
6 7 8 9 10 |
# File 'lib/homeflow/api/collection.rb', line 6 def initialize(collection_response, klass) @has_next_page = collection_response["has_next"] @total = collection_response["total"] collection_response["elements"].each{|element| self << klass.new(element)} end |
Instance Method Details
#has_next_page? ⇒ Boolean
13 14 15 |
# File 'lib/homeflow/api/collection.rb', line 13 def has_next_page? @has_next_page end |
#total ⇒ Object
17 18 19 |
# File 'lib/homeflow/api/collection.rb', line 17 def total @total end |