Class: Tmdb::Tv::Season

Inherits:
Struct show all
Defined in:
lib/tmdb/tv/season.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, filters = {}) ⇒ Object



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

def self.cast(id, season_number, filters={})
  result = Resource.new("/tv/#{id}/season/#{season_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/season.rb', line 11

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

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

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



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

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

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

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



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

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

  create_new_instance_with_normalized_data(result)
end

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



37
38
39
40
# File 'lib/tmdb/tv/season.rb', line 37

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

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



42
43
44
45
46
47
48
# File 'lib/tmdb/tv/season.rb', line 42

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

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

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



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

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

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