Class: Tmdb::Tv::Episode

Inherits:
Struct show all
Defined in:
lib/tmdb/tv/episode.rb

Class Method Summary collapse

Methods inherited from Struct

#analyze_value, #initialize

Constructor Details

This class inherits a constructor from Tmdb::Struct

Class Method Details

.cast(id, season_number, episode_number, filters = {}) ⇒ Object



21
22
23
24
25
26
27
# File 'lib/tmdb/tv/episode.rb', line 21

def self.cast(id, season_number, episode_number, filters={})
  result = Resource.new("/tv/#{id}/season/#{season_number}/episode/#{episode_number}/credits", filters).get

  result['cast'].map do |entry|
    Person.new(entry)
  end
end

.changes(id, filters = {}) ⇒ Object



11
12
13
14
15
16
17
18
19
# File 'lib/tmdb/tv/episode.rb', line 11

def self.changes(id, filters={})
  result = Resource.new("/tv/episode/#{id}/changes", filters).get

  result['changes'].map do |entry|
    change = Change.new(entry)
    change.convert_items!
    change
  end
end

.crew(id, season_number, episode_number, filters = {}) ⇒ Object



29
30
31
32
33
34
35
# File 'lib/tmdb/tv/episode.rb', line 29

def self.crew(id, season_number, episode_number, filters={})
  result = Resource.new("/tv/#{id}/season/#{season_number}/episode/#{episode_number}/credits", filters).get

  result['crew'].map do |entry|
    Person.new(entry)
  end
end

.detail(id, season_number, episode_number, filters = {}) ⇒ Object



5
6
7
8
9
# File 'lib/tmdb/tv/episode.rb', line 5

def self.detail(id, season_number, episode_number, filters={})
  result = Resource.new("/tv/#{id}/season/#{season_number}/episode/#{episode_number}", filters).get

  create_new_instance_with_normalized_data(result)
end

.external_ids(id, season_number, episode_number, filters = {}) ⇒ Object



45
46
47
48
# File 'lib/tmdb/tv/episode.rb', line 45

def self.external_ids(id, season_number, episode_number, filters={})
  result = Resource.new("/tv/#{id}/season/#{season_number}/episode/#{episode_number}/external_ids", filters).get
  self.new(result)
end

.guest_stars(id, season_number, episode_number, filters = {}) ⇒ Object



37
38
39
40
41
42
43
# File 'lib/tmdb/tv/episode.rb', line 37

def self.guest_stars(id, season_number, episode_number, filters={})
  result = Resource.new("/tv/#{id}/season/#{season_number}/episode/#{episode_number}/credits", filters).get

  result['guest_stars'].map do |entry|
    Person.new(entry)
  end
end

.posters(id, season_number, episode_number, filters = {}) ⇒ Object



50
51
52
53
54
55
56
# File 'lib/tmdb/tv/episode.rb', line 50

def self.posters(id, season_number, episode_number, filters={})
  result = Resource.new("/tv/#{id}/season/#{season_number}/episode/#{episode_number}/images", filters).get

  result['stills'].map do |entry|
    Poster.new(entry)
  end
end

.videos(id, season_number, episode_number, filters = {}) ⇒ Object



58
59
60
61
62
63
64
# File 'lib/tmdb/tv/episode.rb', line 58

def self.videos(id, season_number, episode_number, filters={})
  result = Resource.new("/tv/#{id}/season/#{season_number}/episode/#{episode_number}/videos", filters).get

  result['results'].map do |entry|
    Video.new(entry)
  end
end