Class: TvdbPartyV2::Series
- Inherits:
-
Object
- Object
- TvdbPartyV2::Series
- Defined in:
- lib/tvdb_party_v2/series.rb
Instance Attribute Summary collapse
-
#actors ⇒ Object
Returns the value of attribute actors.
-
#air_time ⇒ Object
Returns the value of attribute air_time.
-
#airs_dayofweek ⇒ Object
Returns the value of attribute airs_dayofweek.
-
#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.
-
#imdb_id ⇒ Object
Returns the value of attribute imdb_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.
-
#ratingcount ⇒ Object
Returns the value of attribute ratingcount.
-
#runtime ⇒ Object
Returns the value of attribute runtime.
-
#seasons ⇒ Object
Returns the value of attribute seasons.
-
#status ⇒ Object
Returns the value of attribute status.
Instance Method Summary collapse
- #fanart ⇒ Object
- #get_episode(season_number, episode_number) ⇒ Object
-
#initialize(client, options = {}) ⇒ Series
constructor
A new instance of Series.
- #posters ⇒ Object
- #season(season_number) ⇒ Object
- #season_posters(season_number) ⇒ Object
- #seasonwide ⇒ Object
- #seasonwide_posters(season_number) ⇒ Object
- #series_banners ⇒ Object
Constructor Details
#initialize(client, options = {}) ⇒ Series
Returns a new instance of Series.
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/tvdb_party_v2/series.rb', line 8 def initialize(client, = {}) @client = client @id = ["id"] @name = ["seriesName"] @overview = ["overview"] @network = ["network"] @runtime = ["runtime"] @air_time = ['airsTime'] if ['airsTime'] @imdb_id = ["imdbId"] @status = ["status"] if ["status"] @airs_dayofweek = ["airsDayOfWeek"] if ["genre"] @genres = ["genre"] else @genres = [] end if ["siteRating"] && ["siteRating"] > 0 @rating = ["siteRating"].to_f else @rating = 0 end if ["siteRatingCount"] && ["siteRatingCount"] > 0 @ratingcount = ["siteRatingCount"].to_f else @ratingcount = 0 end begin @first_aired = Time.parse(["firstAired"]).to_i rescue @first_aired = 0 end end |
Instance Attribute Details
#actors ⇒ Object
Returns the value of attribute actors.
5 6 7 |
# File 'lib/tvdb_party_v2/series.rb', line 5 def actors @actors end |
#air_time ⇒ Object
Returns the value of attribute air_time.
5 6 7 |
# File 'lib/tvdb_party_v2/series.rb', line 5 def air_time @air_time end |
#airs_dayofweek ⇒ Object
Returns the value of attribute airs_dayofweek.
5 6 7 |
# File 'lib/tvdb_party_v2/series.rb', line 5 def airs_dayofweek @airs_dayofweek end |
#banners ⇒ Object
Returns the value of attribute banners.
5 6 7 |
# File 'lib/tvdb_party_v2/series.rb', line 5 def @banners end |
#client ⇒ Object (readonly)
Returns the value of attribute client.
4 5 6 |
# File 'lib/tvdb_party_v2/series.rb', line 4 def client @client end |
#first_aired ⇒ Object
Returns the value of attribute first_aired.
5 6 7 |
# File 'lib/tvdb_party_v2/series.rb', line 5 def first_aired @first_aired end |
#genres ⇒ Object
Returns the value of attribute genres.
5 6 7 |
# File 'lib/tvdb_party_v2/series.rb', line 5 def genres @genres end |
#id ⇒ Object
Returns the value of attribute id.
5 6 7 |
# File 'lib/tvdb_party_v2/series.rb', line 5 def id @id end |
#imdb_id ⇒ Object
Returns the value of attribute imdb_id.
5 6 7 |
# File 'lib/tvdb_party_v2/series.rb', line 5 def imdb_id @imdb_id end |
#name ⇒ Object
Returns the value of attribute name.
5 6 7 |
# File 'lib/tvdb_party_v2/series.rb', line 5 def name @name end |
#network ⇒ Object
Returns the value of attribute network.
5 6 7 |
# File 'lib/tvdb_party_v2/series.rb', line 5 def network @network end |
#overview ⇒ Object
Returns the value of attribute overview.
5 6 7 |
# File 'lib/tvdb_party_v2/series.rb', line 5 def overview @overview end |
#rating ⇒ Object
Returns the value of attribute rating.
5 6 7 |
# File 'lib/tvdb_party_v2/series.rb', line 5 def @rating end |
#ratingcount ⇒ Object
Returns the value of attribute ratingcount.
5 6 7 |
# File 'lib/tvdb_party_v2/series.rb', line 5 def @ratingcount end |
#runtime ⇒ Object
Returns the value of attribute runtime.
5 6 7 |
# File 'lib/tvdb_party_v2/series.rb', line 5 def runtime @runtime end |
#seasons ⇒ Object
Returns the value of attribute seasons.
5 6 7 |
# File 'lib/tvdb_party_v2/series.rb', line 5 def seasons @seasons end |
#status ⇒ Object
Returns the value of attribute status.
5 6 7 |
# File 'lib/tvdb_party_v2/series.rb', line 5 def status @status end |
Instance Method Details
#fanart ⇒ Object
53 54 55 |
# File 'lib/tvdb_party_v2/series.rb', line 53 def fanart @banners_fanarts ||= client.(self, 'fanart') end |
#get_episode(season_number, episode_number) ⇒ Object
45 46 47 |
# File 'lib/tvdb_party_v2/series.rb', line 45 def get_episode(season_number, episode_number) client.get_episode(self, season_number, episode_number) end |
#posters ⇒ Object
49 50 51 |
# File 'lib/tvdb_party_v2/series.rb', line 49 def posters @banners_posters ||= client.(self, 'season') end |
#season(season_number) ⇒ Object
86 87 88 |
# File 'lib/tvdb_party_v2/series.rb', line 86 def season(season_number) @season ||= client.get_episode(self, season_number) end |
#season_posters(season_number) ⇒ Object
65 66 67 |
# File 'lib/tvdb_party_v2/series.rb', line 65 def season_posters(season_number) posters.select {|b| b.subkey == season_number.to_s} end |
#seasonwide ⇒ Object
61 62 63 |
# File 'lib/tvdb_party_v2/series.rb', line 61 def seasonwide @banners_seasonwide ||= client.(self, 'seasonwide') end |
#seasonwide_posters(season_number) ⇒ Object
69 70 71 |
# File 'lib/tvdb_party_v2/series.rb', line 69 def seasonwide_posters(season_number) seasonwide.select {|b| b.subkey == season_number.to_s} end |
#series_banners ⇒ Object
57 58 59 |
# File 'lib/tvdb_party_v2/series.rb', line 57 def @banners_series ||= client.(self, 'series') end |