Class: TMDb::Person
- Extended by:
- Searchable
- Defined in:
- lib/tmdb-api/person.rb
Constant Summary collapse
- ATTRIBUTES =
:id, :adult, :also_known_as, :biography, :homepage, :name, :place_of_birth, :profile_path, :popularity, :imdb_id, :known_for
Class Method Summary collapse
-
.find(id, options = {}) ⇒ Object
Public: Gets the basic person information for a specific person ID.
-
.images(id) ⇒ Object
Public: Gets the images for a specific person ID.
-
.popular(options = {}) ⇒ Object
Public: Gets a list of popular people.
Instance Method Summary collapse
-
#birthday ⇒ Object
Public: return the parsed birthday.
-
#deathday ⇒ Object
Public: return the parsed deathday.
Methods included from Searchable
Methods inherited from Base
Constructor Details
This class inherits a constructor from TMDb::Base
Class Method Details
.find(id, options = {}) ⇒ Object
19 20 21 22 |
# File 'lib/tmdb-api/person.rb', line 19 def self.find(id, = {}) res = get("/person/#{id}", query: ) res.success? ? Person.new(res) : bad_response(res) end |
.images(id) ⇒ Object
31 32 33 34 |
# File 'lib/tmdb-api/person.rb', line 31 def self.images(id) res = get("/person/#{id}/images") res.success? ? res : bad_response(res) end |
Instance Method Details
#birthday ⇒ Object
Public: return the parsed birthday.
56 57 58 |
# File 'lib/tmdb-api/person.rb', line 56 def birthday Date.parse(@birthday) rescue nil end |
#deathday ⇒ Object
Public: return the parsed deathday.
61 62 63 |
# File 'lib/tmdb-api/person.rb', line 61 def deathday Date.parse(@deathday) rescue nil end |