Class: Igdb::Person

Inherits:
ApiResource show all
Defined in:
lib/igdb/models/person.rb

Class Method Summary collapse

Class Method Details

.all(opts = {}) ⇒ Object



11
12
13
14
15
16
17
# File 'lib/igdb/models/person.rb', line 11

def self.all(opts={})
  params = Hash.new.tap do |hash|
    hash['offset'] = opts[:offset] || 0
    hash['limit'] = opts[:limit] || 100
  end
  build_collection(Igdb::Requester.get("people", params)['people'], Igdb::PersonRepresenter)
end

.find(id) ⇒ Object



7
8
9
# File 'lib/igdb/models/person.rb', line 7

def self.find(id)
  build_single_resource(Igdb::Requester.get("people/#{id}")['person'], Igdb::PersonRepresenter)
end

.metaObject



3
4
5
# File 'lib/igdb/models/person.rb', line 3

def self.meta
  build_single_resource(Igdb::Requester.get('people/meta'), Igdb::PersonRepresenter).size
end