Class: TheTvDbParty::Banner
- Inherits:
-
Object
- Object
- TheTvDbParty::Banner
- Defined in:
- lib/thetvdb_party/banner.rb
Overview
Banner holds information about banners associated with series and seasons.
Instance Attribute Summary collapse
-
#banner_path_relative ⇒ Object
readonly
Can be appended to <mirrorpath>/banners/ to determine the actual location of the artwork.
-
#banner_type ⇒ Object
readonly
This can be poster, fanart, series or season.
-
#banner_type_2 ⇒ Object
readonly
For series banners it can be text, graphical, or blank.
-
#client ⇒ Object
readonly
The client that was used to get this banner.
-
#dark_accent_color ⇒ Object
readonly
Returns either nil or a RGB color.
-
#id ⇒ Object
readonly
Unique ID for this banner.
-
#language ⇒ Object
readonly
Some banners list the series name in a foreign language.
-
#light_accent_color ⇒ Object
readonly
Returns either nil or a RGB color.
-
#neutral_midtone_color ⇒ Object
readonly
Returns either nil or a RGB color.
-
#rating ⇒ Object
readonly
Either nil or a decimal with four decimal places.
-
#rating_count ⇒ Object
readonly
Always returns an unsigned integer.
-
#season ⇒ Object
readonly
If the banner is for a specific season.
-
#series_name ⇒ Object
readonly
This can be true or false.
-
#thumbnail_path_relative ⇒ Object
readonly
Used exactly the same way as BannerPath, only shows if BannerType is fanart.
-
#vignette_path_relative ⇒ Object
readonly
Returns the value of attribute vignette_path_relative.
Instance Method Summary collapse
- #banner_path_full ⇒ Object
-
#initialize(client, hashValues) ⇒ Banner
constructor
Initializes a new Banner as it was retrieved from a given client.
- #thumbnail_path_full ⇒ Object
- #vignette_path_full ⇒ Object
Constructor Details
#initialize(client, hashValues) ⇒ Banner
Initializes a new Banner as it was retrieved from a given client.
- Parameters
client-
The TheTvDbParty::Client instance that retrieved the record this banner belongs to.
hashValues-
A Hash=> String instance that maps the banner element names to their string values.
40 41 42 43 44 45 |
# File 'lib/thetvdb_party/banner.rb', line 40 def initialize(client, hashValues) @client = client @hashValues = hashValues read_hash_values end |
Instance Attribute Details
#banner_path_relative ⇒ Object (readonly)
Can be appended to <mirrorpath>/banners/ to determine the actual location of the artwork.
10 11 12 |
# File 'lib/thetvdb_party/banner.rb', line 10 def @banner_path_relative end |
#banner_type ⇒ Object (readonly)
This can be poster, fanart, series or season.
15 16 17 |
# File 'lib/thetvdb_party/banner.rb', line 15 def @banner_type end |
#banner_type_2 ⇒ Object (readonly)
For series banners it can be text, graphical, or blank. For season banners it can be season or seasonwide. For fanart it can be 1280x720 or 1920x1080. For poster it will always be 680x1000. Blank banners will leave the title and show logo off the banner. Text banners will show the series name as plain text in an Arial font. Graphical banners will show the series name in the show’s official font or will display the actual logo for the show. Season banners are the standard DVD cover format while wide season banners will be the same dimensions as the series banners.
18 19 20 |
# File 'lib/thetvdb_party/banner.rb', line 18 def @banner_type_2 end |
#client ⇒ Object (readonly)
The client that was used to get this banner
6 7 8 |
# File 'lib/thetvdb_party/banner.rb', line 6 def client @client end |
#dark_accent_color ⇒ Object (readonly)
Returns either nil or a RGB color. These are colors the artist picked that go well with the image. It’s meant to be used if you want to write something over the image, it gives you a good idea of what colors may work and show up well. Only shows if BannerType is fanart.
32 33 34 |
# File 'lib/thetvdb_party/banner.rb', line 32 def dark_accent_color @dark_accent_color end |
#id ⇒ Object (readonly)
Unique ID for this banner
8 9 10 |
# File 'lib/thetvdb_party/banner.rb', line 8 def id @id end |
#language ⇒ Object (readonly)
Some banners list the series name in a foreign language. The language abbreviation will be listed here.
20 21 22 |
# File 'lib/thetvdb_party/banner.rb', line 20 def language @language end |
#light_accent_color ⇒ Object (readonly)
Returns either nil or a RGB color. These are colors the artist picked that go well with the image. It’s meant to be used if you want to write something over the image, it gives you a good idea of what colors may work and show up well. Only shows if BannerType is fanart.
30 31 32 |
# File 'lib/thetvdb_party/banner.rb', line 30 def light_accent_color @light_accent_color end |
#neutral_midtone_color ⇒ Object (readonly)
Returns either nil or a RGB color. These are colors the artist picked that go well with the image. It’s meant to be used if you want to write something over the image, it gives you a good idea of what colors may work and show up well. Only shows if BannerType is fanart.
34 35 36 |
# File 'lib/thetvdb_party/banner.rb', line 34 def neutral_midtone_color @neutral_midtone_color end |
#rating ⇒ Object (readonly)
Either nil or a decimal with four decimal places. The rating the banner currently has on the site.
24 25 26 |
# File 'lib/thetvdb_party/banner.rb', line 24 def @rating end |
#rating_count ⇒ Object (readonly)
Always returns an unsigned integer. Number of people who have rated the image.
26 27 28 |
# File 'lib/thetvdb_party/banner.rb', line 26 def @rating_count end |
#season ⇒ Object (readonly)
If the banner is for a specific season.
22 23 24 |
# File 'lib/thetvdb_party/banner.rb', line 22 def season @season end |
#series_name ⇒ Object (readonly)
This can be true or false. Only shows if BannerType is fanart. Indicates if the seriesname is included in the image or not.
28 29 30 |
# File 'lib/thetvdb_party/banner.rb', line 28 def series_name @series_name end |
#thumbnail_path_relative ⇒ Object (readonly)
Used exactly the same way as BannerPath, only shows if BannerType is fanart.
12 13 14 |
# File 'lib/thetvdb_party/banner.rb', line 12 def thumbnail_path_relative @thumbnail_path_relative end |
#vignette_path_relative ⇒ Object (readonly)
Returns the value of attribute vignette_path_relative.
13 14 15 |
# File 'lib/thetvdb_party/banner.rb', line 13 def vignette_path_relative @vignette_path_relative end |
Instance Method Details
#banner_path_full ⇒ Object
47 48 49 50 51 |
# File 'lib/thetvdb_party/banner.rb', line 47 def if @banner_path_relative return (URI::join(BASE_URL, "banners/", @banner_path_relative)) end end |
#thumbnail_path_full ⇒ Object
53 54 55 56 57 |
# File 'lib/thetvdb_party/banner.rb', line 53 def thumbnail_path_full if @thumbnail_path_relative return (URI::join(BASE_URL, "banners/", @thumbnail_path_relative)) end end |
#vignette_path_full ⇒ Object
59 60 61 62 63 |
# File 'lib/thetvdb_party/banner.rb', line 59 def vignette_path_full if @vignette_path_relative return (URI::join(BASE_URL, "banners/", @vignette_path_relative)) end end |