class TvMaze::Show
Public Class Methods
all(page = 1)
click to toggle source
# File lib/tv_maze/models/show.rb, line 38 def self.all(page = 1) build_collection(TvMaze::Requester.get("/shows", {page: page}), TvMaze::ShowRepresenter) end
alternative_names(id)
click to toggle source
A list of AKA's (aliases) for a show. An AKA with its country set to null indicates an AKA in the show's original country. Otherwise, it's the AKA for that show in the given foreign country.
# File lib/tv_maze/models/show.rb, line 12 def self.alternative_names(id) TvMaze::AlternativeName.build_collection(TvMaze::Requester.get("shows/#{id}/akas"), TvMaze::AlternativeNameRepresenter) end
cast(id)
click to toggle source
A list of main cast for a show. Each cast item is a combination of a person and a character. Items are ordered by importance, which is determined by the total number of appearances of the given character in this show.
# File lib/tv_maze/models/show.rb, line 7 def self.cast(id) TvMaze::Cast.build_collection(TvMaze::Requester.get("shows/#{id}/cast"), TvMaze::CastRepresenter) end
episodes(id, special: false)
click to toggle source
# File lib/tv_maze/models/show.rb, line 21 def self.episodes(id, special: false) params = {specials: special ? 1 : 0} TvMaze::Episode.build_collection(TvMaze::Requester.get("shows/#{id}/episodes", params), TvMaze::EpisodeRepresenter) end
find(id, embed: [])
click to toggle source
# File lib/tv_maze/models/show.rb, line 2 def self.find(id, embed: []) build_single_resource(TvMaze::Requester.get("shows/#{id}", {embed: embed}), TvMaze::ShowRepresenter) end
find_by_imdb_id(imdb)
click to toggle source
# File lib/tv_maze/models/show.rb, line 26 def self.find_by_imdb_id(imdb) build_single_resource(TvMaze::Requester.get("lookup/shows", {imdb: imdb}), TvMaze::ShowRepresenter) end
find_by_tvdb_id(tvdb)
click to toggle source
# File lib/tv_maze/models/show.rb, line 34 def self.find_by_tvdb_id(tvdb) build_single_resource(TvMaze::Requester.get("lookup/shows", {thetvdb: tvdb}), TvMaze::ShowRepresenter) end
find_by_tvrage_id(tvrage)
click to toggle source
# File lib/tv_maze/models/show.rb, line 30 def self.find_by_tvrage_id(tvrage) build_single_resource(TvMaze::Requester.get("lookup/shows", {tvrage: tvrage}), TvMaze::ShowRepresenter) end
search(q)
click to toggle source
# File lib/tv_maze/models/show.rb, line 42 def self.search(q) result = TvMaze::Requester.get("search/shows", {q: q}) build_collection(result.map{|show| show['show'] }, TvMaze::ShowRepresenter) end
seasons(id)
click to toggle source
A complete list of seasons for the given show. Seasons are returned in ascending order and contain the full information that's known about them.
# File lib/tv_maze/models/show.rb, line 17 def self.seasons(id) TvMaze::Season.build_collection(TvMaze::Requester.get("shows/#{id}/seasons"), TvMaze::SeasonRepresenter) end