Class: Tmdb::Episode

Inherits:
Resource show all
Defined in:
lib/themoviedb/episode.rb

Class Method Summary collapse

Methods inherited from Resource

endpoint_id, endpoints, has_resource, #initialize, list, search

Constructor Details

This class inherits a constructor from Tmdb::Resource

Class Method Details

.cast(id, season, episode, conditions = {}) ⇒ Object

Get the TV episode cast credits by combination of season and episode number.


13
14
15
16
# File 'lib/themoviedb/episode.rb', line 13

def self.cast(id, season, episode, conditions={})
  search = Tmdb::Search.new("/tv/#{self.endpoint_id + id.to_s}/season/#{self.endpoint_id + season.to_s}/#{self.endpoints[:singular]}/#{self.endpoint_id + episode.to_s}/credits")
  search.fetch_response['cast']
end

.crew(id, season, episode, conditions = {}) ⇒ Object

Get the TV episode crew credits by combination of season and episode number.


19
20
21
22
# File 'lib/themoviedb/episode.rb', line 19

def self.crew(id, season, episode, conditions={})
  search = Tmdb::Search.new("/tv/#{self.endpoint_id + id.to_s}/season/#{self.endpoint_id + season.to_s}/#{self.endpoints[:singular]}/#{self.endpoint_id + episode.to_s}/credits")
  search.fetch_response['crew']
end

.detail(id, season, episode, conditions = {}) ⇒ Object

Get the primary information about a TV episode by combination of a season and episode number.


6
7
8
9
10
# File 'lib/themoviedb/episode.rb', line 6

def self.detail(id, season, episode, conditions={})
  search = Tmdb::Search.new("/tv/#{self.endpoint_id + id.to_s}/season/#{self.endpoint_id + season.to_s}/#{self.endpoints[:singular]}/#{self.endpoint_id + episode.to_s}")
  search.filter(conditions)
  search.fetch_response
end

.external_ids(id, season, episode, conditions = {}) ⇒ Object

Get the external ids for a TV episode by comabination of a season and episode number.


25
26
27
28
# File 'lib/themoviedb/episode.rb', line 25

def self.external_ids(id, season, episode, conditions={})
  search = Tmdb::Search.new("/tv/#{self.endpoint_id + id.to_s}/season/#{self.endpoint_id + season.to_s}/#{self.endpoints[:singular]}/#{self.endpoint_id + episode.to_s}/external_ids")
  search.fetch_response
end

.images(id, season, episode, conditions = {}) ⇒ Object

Get the images (episode stills) for a TV episode by combination of a season and episode number.


31
32
33
34
# File 'lib/themoviedb/episode.rb', line 31

def self.images(id, season, episode, conditions={})
  search = Tmdb::Search.new("/tv/#{self.endpoint_id + id.to_s}/season/#{self.endpoint_id + season.to_s}/#{self.endpoints[:singular]}/#{self.endpoint_id + episode.to_s}/images")
  search.fetch_response
end