Class: TvdbPartyV2::Episode
- Inherits:
-
Object
- Object
- TvdbPartyV2::Episode
- Defined in:
- lib/tvdb_party_v2/episode.rb
Instance Attribute Summary collapse
-
#air_date ⇒ Object
Returns the value of attribute air_date.
-
#client ⇒ Object
readonly
Returns the value of attribute client.
-
#director ⇒ Object
Returns the value of attribute director.
-
#guest_stars ⇒ Object
Returns the value of attribute guest_stars.
-
#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.
-
#number ⇒ Object
Returns the value of attribute number.
-
#overview ⇒ Object
Returns the value of attribute overview.
-
#rating ⇒ Object
Returns the value of attribute rating.
-
#ratingcount ⇒ Object
Returns the value of attribute ratingcount.
-
#season_id ⇒ Object
Returns the value of attribute season_id.
-
#season_number ⇒ Object
Returns the value of attribute season_number.
-
#thumb ⇒ Object
Returns the value of attribute thumb.
-
#writer ⇒ Object
Returns the value of attribute writer.
Instance Method Summary collapse
-
#initialize(client, options = {}) ⇒ Episode
constructor
A new instance of Episode.
- #series ⇒ Object
Constructor Details
#initialize(client, options = {}) ⇒ Episode
Returns a new instance of Episode.
7 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 44 |
# File 'lib/tvdb_party_v2/episode.rb', line 7 def initialize(client, = {}) @client = client @id = ["id"] @season_number = ["airedSeason"] @number = ["airedEpisodeNumber"] @name = ["episodeName"] @overview = ["overview"] @thumb = "http://www.thetvdb.com/banners/" + ["filename"] unless ["filename"].nil? @director = ["directors"] @writer = ["writers"] @series_id = ["seriesId"] @season_id = ["airedSeasonID"] @imdb_id = ["imdbId"] if ["guestStars"] @guest_stars = ["guestStars"] else @guest_stars = [] end begin @air_date = Time.parse(["firstAired"]).to_i rescue @air_date = 0 end if ["siteRating"] && ["siteRating"] > 0 @rating = ["siteRating"].to_f else @rating = 0 end if ["siteRatingCount"] && ["siteRatingCount"] > 0 @ratingcount = ["siteRatingCount"] else @ratingcount = 0 end end |
Instance Attribute Details
#air_date ⇒ Object
Returns the value of attribute air_date.
5 6 7 |
# File 'lib/tvdb_party_v2/episode.rb', line 5 def air_date @air_date end |
#client ⇒ Object (readonly)
Returns the value of attribute client.
4 5 6 |
# File 'lib/tvdb_party_v2/episode.rb', line 4 def client @client end |
#director ⇒ Object
Returns the value of attribute director.
5 6 7 |
# File 'lib/tvdb_party_v2/episode.rb', line 5 def director @director end |
#guest_stars ⇒ Object
Returns the value of attribute guest_stars.
5 6 7 |
# File 'lib/tvdb_party_v2/episode.rb', line 5 def guest_stars @guest_stars end |
#id ⇒ Object
Returns the value of attribute id.
5 6 7 |
# File 'lib/tvdb_party_v2/episode.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/episode.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/episode.rb', line 5 def name @name end |
#number ⇒ Object
Returns the value of attribute number.
5 6 7 |
# File 'lib/tvdb_party_v2/episode.rb', line 5 def number @number end |
#overview ⇒ Object
Returns the value of attribute overview.
5 6 7 |
# File 'lib/tvdb_party_v2/episode.rb', line 5 def overview @overview end |
#rating ⇒ Object
Returns the value of attribute rating.
5 6 7 |
# File 'lib/tvdb_party_v2/episode.rb', line 5 def @rating end |
#ratingcount ⇒ Object
Returns the value of attribute ratingcount.
5 6 7 |
# File 'lib/tvdb_party_v2/episode.rb', line 5 def @ratingcount end |
#season_id ⇒ Object
Returns the value of attribute season_id.
5 6 7 |
# File 'lib/tvdb_party_v2/episode.rb', line 5 def season_id @season_id end |
#season_number ⇒ Object
Returns the value of attribute season_number.
5 6 7 |
# File 'lib/tvdb_party_v2/episode.rb', line 5 def season_number @season_number end |
#thumb ⇒ Object
Returns the value of attribute thumb.
5 6 7 |
# File 'lib/tvdb_party_v2/episode.rb', line 5 def thumb @thumb end |
#writer ⇒ Object
Returns the value of attribute writer.
5 6 7 |
# File 'lib/tvdb_party_v2/episode.rb', line 5 def writer @writer end |
Instance Method Details
#series ⇒ Object
46 47 48 |
# File 'lib/tvdb_party_v2/episode.rb', line 46 def series client.get_series_by_id(@series.id) end |