Class: TvdbPartyV2::Banner
- Inherits:
-
Object
- Object
- TvdbPartyV2::Banner
- Defined in:
- lib/tvdb_party_v2/banner.rb
Instance Attribute Summary collapse
-
#banner_resolution ⇒ Object
Returns the value of attribute banner_resolution.
-
#banner_type ⇒ Object
Returns the value of attribute banner_type.
-
#path ⇒ Object
Returns the value of attribute path.
-
#ratingaverage ⇒ Object
Returns the value of attribute ratingaverage.
-
#ratingcount ⇒ Object
Returns the value of attribute ratingcount.
-
#subkey ⇒ Object
Returns the value of attribute subkey.
-
#thumbnail_path ⇒ Object
Returns the value of attribute thumbnail_path.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Banner
constructor
A new instance of Banner.
- #thumb_url ⇒ Object
- #url ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Banner
Returns a new instance of Banner.
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/tvdb_party_v2/banner.rb', line 5 def initialize( = {}) @banner_type = ["keyType"] @banner_resolution = ["resolution"] @subkey = ["subKey"] @path = ["fileName"] if ["ratingsInfo"]["average"] && ["ratingsInfo"]["average"] > 0 @ratingaverage = ["ratingsInfo"]["average"].to_f else @ratingaverage = 0 end if ["ratingsInfo"]["count"] && ["ratingsInfo"]["count"] > 0 @ratingcount = ["ratingsInfo"]["count"] else @ratingcount = 0 end end |
Instance Attribute Details
#banner_resolution ⇒ Object
Returns the value of attribute banner_resolution.
3 4 5 |
# File 'lib/tvdb_party_v2/banner.rb', line 3 def @banner_resolution end |
#banner_type ⇒ Object
Returns the value of attribute banner_type.
3 4 5 |
# File 'lib/tvdb_party_v2/banner.rb', line 3 def @banner_type end |
#path ⇒ Object
Returns the value of attribute path.
3 4 5 |
# File 'lib/tvdb_party_v2/banner.rb', line 3 def path @path end |
#ratingaverage ⇒ Object
Returns the value of attribute ratingaverage.
3 4 5 |
# File 'lib/tvdb_party_v2/banner.rb', line 3 def @ratingaverage end |
#ratingcount ⇒ Object
Returns the value of attribute ratingcount.
3 4 5 |
# File 'lib/tvdb_party_v2/banner.rb', line 3 def @ratingcount end |
#subkey ⇒ Object
Returns the value of attribute subkey.
3 4 5 |
# File 'lib/tvdb_party_v2/banner.rb', line 3 def subkey @subkey end |
#thumbnail_path ⇒ Object
Returns the value of attribute thumbnail_path.
3 4 5 |
# File 'lib/tvdb_party_v2/banner.rb', line 3 def thumbnail_path @thumbnail_path end |
Instance Method Details
#thumb_url ⇒ Object
29 30 31 |
# File 'lib/tvdb_party_v2/banner.rb', line 29 def thumb_url "https://www.thetvdb.com/banners/_cache/" + @path end |
#url ⇒ Object
25 26 27 |
# File 'lib/tvdb_party_v2/banner.rb', line 25 def url "https://www.thetvdb.com/banners/" + @path end |