Class: Fathom::List
Instance Method Summary collapse
- #first_id ⇒ Object
- #has_more? ⇒ Boolean
-
#initialize(attributes) ⇒ List
constructor
A new instance of List.
- #last_id ⇒ Object
Methods inherited from Object
#method_missing, #respond_to_missing?
Constructor Details
#initialize(attributes) ⇒ List
Returns a new instance of List.
3 4 5 6 7 8 |
# File 'lib/fathom/objects/list.rb', line 3 def initialize(attributes) super @attributes["data"].map! do |entry| Fathom.build_object(entry) end end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Fathom::Object
Instance Method Details
#first_id ⇒ Object
18 19 20 |
# File 'lib/fathom/objects/list.rb', line 18 def first_id @attributes["data"].first.id end |
#has_more? ⇒ Boolean
10 11 12 |
# File 'lib/fathom/objects/list.rb', line 10 def has_more? @attributes["has_more"] end |
#last_id ⇒ Object
14 15 16 |
# File 'lib/fathom/objects/list.rb', line 14 def last_id @attributes["data"].last.id end |