Class: Tmdb::TV
Constant Summary collapse
- @@fields =
[ :backdrop_path, :created_by, :episode_run_time, :first_air_date, :genres, :homepage, :id, :in_production, :languages, :last_air_date, :name, :networks, :number_of_episodes, :number_of_seasons, :original_name, :origin_country, :overview, :popularity, :poster_path, :seasons, :status, :vote_average, :vote_count, :credits, :external_ids ]
Class Method Summary collapse
-
.cast(id, _conditions = {}) ⇒ Object
Get the cast information about a TV series.
-
.crew(id, _conditions = {}) ⇒ Object
Get the crew information about a TV series.
-
.discover(conditions = {}) ⇒ Object
Discover TV shows by different types of data like average rating, number of votes, genres, the network they aired on and air dates.
-
.external_ids(id, _conditions = {}) ⇒ Object
Get the external ids that we have stored for a TV series.
-
.images(id, _conditions = {}) ⇒ Object
Get the images (posters and backdrops) for a TV series.
-
.popular ⇒ Object
Get the list of popular TV shows.
-
.top_rated ⇒ Object
Get the list of top rated TV shows.
Methods inherited from Resource
detail, endpoint_id, endpoints, has_resource, #initialize, list, search
Constructor Details
This class inherits a constructor from Tmdb::Resource
Class Method Details
.cast(id, _conditions = {}) ⇒ Object
Get the cast information about a TV series.
58 59 60 61 |
# File 'lib/themoviedb/tv.rb', line 58 def self.cast(id, _conditions = {}) search = Tmdb::Search.new("/#{endpoints[:singular]}/#{endpoint_id + id.to_s}/credits") search.fetch_response['cast'] end |
.crew(id, _conditions = {}) ⇒ Object
Get the crew information about a TV series.
64 65 66 67 |
# File 'lib/themoviedb/tv.rb', line 64 def self.crew(id, _conditions = {}) search = Tmdb::Search.new("/#{endpoints[:singular]}/#{endpoint_id + id.to_s}/credits") search.fetch_response['crew'] end |
.discover(conditions = {}) ⇒ Object
Discover TV shows by different types of data like average rating, number of votes, genres, the network they aired on and air dates
51 52 53 54 55 |
# File 'lib/themoviedb/tv.rb', line 51 def self.discover(conditions = {}) search = Tmdb::Search.new('/discover/tv') search.filter(conditions) search.fetch.collect { |result| new(result) } end |
.external_ids(id, _conditions = {}) ⇒ Object
Get the external ids that we have stored for a TV series.
70 71 72 73 |
# File 'lib/themoviedb/tv.rb', line 70 def self.external_ids(id, _conditions = {}) search = Tmdb::Search.new("/#{endpoints[:singular]}/#{endpoint_id + id.to_s}/external_ids") search.fetch_response end |
.images(id, _conditions = {}) ⇒ Object
Get the images (posters and backdrops) for a TV series.
76 77 78 79 |
# File 'lib/themoviedb/tv.rb', line 76 def self.images(id, _conditions = {}) search = Tmdb::Search.new("/#{endpoints[:singular]}/#{endpoint_id + id.to_s}/images") search.fetch_response end |
.popular ⇒ Object
Get the list of popular TV shows. This list refreshes every day.
39 40 41 42 |
# File 'lib/themoviedb/tv.rb', line 39 def self.popular search = Tmdb::Search.new('/tv/popular') search.fetch.collect { |result| new(result) } end |
.top_rated ⇒ Object
Get the list of top rated TV shows. By default, this list will only include TV shows that have 2 or more votes. This list refreshes every day.
45 46 47 48 |
# File 'lib/themoviedb/tv.rb', line 45 def self.top_rated search = Tmdb::Search.new('/tv/top_rated') search.fetch.collect { |result| new(result) } end |