Class: TvdbParty::Series
- Inherits:
-
Object
- Object
- TvdbParty::Series
- Defined in:
- lib/tvdb_party/series.rb
Instance Attribute Summary collapse
-
#actors ⇒ Object
Returns the value of attribute actors.
-
#banners ⇒ Object
Returns the value of attribute banners.
-
#client ⇒ Object
readonly
Returns the value of attribute client.
-
#first_aired ⇒ Object
Returns the value of attribute first_aired.
-
#genres ⇒ Object
Returns the value of attribute genres.
-
#id ⇒ Object
Returns the value of attribute id.
-
#name ⇒ Object
Returns the value of attribute name.
-
#network ⇒ Object
Returns the value of attribute network.
-
#overview ⇒ Object
Returns the value of attribute overview.
-
#rating ⇒ Object
Returns the value of attribute rating.
-
#runtime ⇒ Object
Returns the value of attribute runtime.
-
#seasons ⇒ Object
Returns the value of attribute seasons.
Instance Method Summary collapse
- #fanart(language) ⇒ Object
- #get_episode(season_number, episode_number) ⇒ Object
-
#initialize(client, options = {}) ⇒ Series
constructor
A new instance of Series.
- #posters(language) ⇒ Object
- #season(season_number) ⇒ Object
- #season_posters(season_number, language) ⇒ Object
- #seasonwide_posters(season_number, language) ⇒ Object
- #series_banners(language) ⇒ Object
Constructor Details
#initialize(client, options = {}) ⇒ Series
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/tvdb_party/series.rb', line 7 def initialize(client, ={}) @client = client @id = ["id"] @name = ["SeriesName"] @overview = ["Overview"] @network = ["Network"] @runtime = ["Runtime"] @first_aired = Date.parse(["FirstAired"]) @genres = ["Genre"][1..-1].split("|") @actors = ["Actors"][1..-1].split("|") if ["Rating"].size > 0 = ["Rating"].to_f else = 0 end end |
Instance Attribute Details
#actors ⇒ Object
Returns the value of attribute actors.
4 5 6 |
# File 'lib/tvdb_party/series.rb', line 4 def actors @actors end |
#banners ⇒ Object
Returns the value of attribute banners.
4 5 6 |
# File 'lib/tvdb_party/series.rb', line 4 def end |
#client ⇒ Object (readonly)
Returns the value of attribute client.
3 4 5 |
# File 'lib/tvdb_party/series.rb', line 3 def client @client end |
#first_aired ⇒ Object
Returns the value of attribute first_aired.
4 5 6 |
# File 'lib/tvdb_party/series.rb', line 4 def first_aired @first_aired end |
#genres ⇒ Object
Returns the value of attribute genres.
4 5 6 |
# File 'lib/tvdb_party/series.rb', line 4 def genres @genres end |
#id ⇒ Object
Returns the value of attribute id.
4 5 6 |
# File 'lib/tvdb_party/series.rb', line 4 def id @id end |
#name ⇒ Object
Returns the value of attribute name.
4 5 6 |
# File 'lib/tvdb_party/series.rb', line 4 def name @name end |
#network ⇒ Object
Returns the value of attribute network.
4 5 6 |
# File 'lib/tvdb_party/series.rb', line 4 def network @network end |
#overview ⇒ Object
Returns the value of attribute overview.
4 5 6 |
# File 'lib/tvdb_party/series.rb', line 4 def overview @overview end |
#rating ⇒ Object
Returns the value of attribute rating.
4 5 6 |
# File 'lib/tvdb_party/series.rb', line 4 def end |
#runtime ⇒ Object
Returns the value of attribute runtime.
4 5 6 |
# File 'lib/tvdb_party/series.rb', line 4 def runtime @runtime end |
#seasons ⇒ Object
Returns the value of attribute seasons.
4 5 6 |
# File 'lib/tvdb_party/series.rb', line 4 def seasons @seasons end |
Instance Method Details
#fanart(language) ⇒ Object
35 36 37 |
# File 'lib/tvdb_party/series.rb', line 35 def fanart(language) .select{|b| b. == 'fanart' && b.language == language} end |
#get_episode(season_number, episode_number) ⇒ Object
27 28 29 |
# File 'lib/tvdb_party/series.rb', line 27 def get_episode(season_number, episode_number) client.get_episode(self, season_number, episode_number) end |
#posters(language) ⇒ Object
31 32 33 |
# File 'lib/tvdb_party/series.rb', line 31 def posters(language) .select{|b| b. == 'poster' && b.language == language} end |
#season(season_number) ⇒ Object
59 60 61 |
# File 'lib/tvdb_party/series.rb', line 59 def season(season_number) seasons.detect{|s| s.number == season_number} end |
#season_posters(season_number, language) ⇒ Object
43 44 45 |
# File 'lib/tvdb_party/series.rb', line 43 def season_posters(season_number, language) .select{|b| b. == 'season' && b. == 'season' && b.season == season_number.to_s && b.language == language} end |
#seasonwide_posters(season_number, language) ⇒ Object
47 48 49 |
# File 'lib/tvdb_party/series.rb', line 47 def seasonwide_posters(season_number, language) .select{|b| b. == 'season' && b. == 'seasonwide' && b.season == season_number.to_s && b.language == language} end |
#series_banners(language) ⇒ Object
39 40 41 |
# File 'lib/tvdb_party/series.rb', line 39 def (language) .select{|b| b. == 'series' && b.language == language} end |