class TMDb::Person
Constants
- ATTRIBUTES
Public Class Methods
find(id, options = {})
click to toggle source
Public: Gets the basic person information for a specific person ID.
id - The ID of the person. options - The hash options used to filter the search (default: {}):
More information about the options, check the api documentation
Examples
TMDb::Person.find(138)
# File lib/tmdb-api/person.rb, line 19 def self.find(id, options = {}) res = get("/person/#{id}", query: options) res.success? ? Person.new(res) : bad_response(res) end
images(id)
click to toggle source
Public: Gets the images for a specific person ID.
id - The person's ID
Examples
TMDb::Person.images(138)
# File lib/tmdb-api/person.rb, line 31 def self.images(id) res = get("/person/#{id}/images") res.success? ? res : bad_response(res) end
popular(options = {})
click to toggle source
Public: Gets a list of popular people.
options - The hash options used to filter the search (default: {}):
:page - List's page.
Examples
TMDb::Person.popular TMDb::Person.popular(page: 4)
# File lib/tmdb-api/person.rb, line 45 def self.popular(options = {}) res = get('/person/popular', query: options) if res.success? res['results'].map { |person| Person.new(person) } else bad_response(res) end end
Public Instance Methods
birthday()
click to toggle source
Public: return the parsed birthday.
# File lib/tmdb-api/person.rb, line 56 def birthday Date.parse(@birthday) rescue nil end
deathday()
click to toggle source
Public: return the parsed deathday.
# File lib/tmdb-api/person.rb, line 61 def deathday Date.parse(@deathday) rescue nil end