Class: Fathom::List

Inherits:
Object show all
Defined in:
lib/fathom/objects/list.rb

Instance Method Summary collapse

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_idObject



18
19
20
# File 'lib/fathom/objects/list.rb', line 18

def first_id
  @attributes["data"].first.id
end

#has_more?Boolean

Returns:

  • (Boolean)


10
11
12
# File 'lib/fathom/objects/list.rb', line 10

def has_more?
  @attributes["has_more"]
end

#last_idObject



14
15
16
# File 'lib/fathom/objects/list.rb', line 14

def last_id
  @attributes["data"].last.id
end