Class: Videoinfo::Results::TvResult
- Inherits:
-
Videoinfo::Result
- Object
- Videoinfo::Result
- Videoinfo::Results::TvResult
- Defined in:
- lib/videoinfo/results/tv_result.rb
Instance Attribute Summary collapse
-
#air_date ⇒ Object
Returns the value of attribute air_date.
-
#country ⇒ Object
Returns the value of attribute country.
-
#episode_imdb_id ⇒ Object
Returns the value of attribute episode_imdb_id.
-
#episode_number ⇒ Object
Returns the value of attribute episode_number.
-
#episode_rating ⇒ Object
Returns the value of attribute episode_rating.
-
#episode_title ⇒ Object
Returns the value of attribute episode_title.
-
#episode_url ⇒ Object
Returns the value of attribute episode_url.
-
#genres ⇒ Object
Returns the value of attribute genres.
-
#imdb_id ⇒ Object
Returns the value of attribute imdb_id.
-
#plot ⇒ Object
Returns the value of attribute plot.
-
#premiered ⇒ Object
Returns the value of attribute premiered.
-
#rating ⇒ Object
Returns the value of attribute rating.
-
#season_number ⇒ Object
Returns the value of attribute season_number.
-
#title ⇒ Object
Returns the value of attribute title.
Attributes inherited from Videoinfo::Result
Instance Method Summary collapse
Instance Attribute Details
#air_date ⇒ Object
Returns the value of attribute air_date.
5 6 7 |
# File 'lib/videoinfo/results/tv_result.rb', line 5 def air_date @air_date end |
#country ⇒ Object
Returns the value of attribute country.
5 6 7 |
# File 'lib/videoinfo/results/tv_result.rb', line 5 def country @country end |
#episode_imdb_id ⇒ Object
Returns the value of attribute episode_imdb_id.
5 6 7 |
# File 'lib/videoinfo/results/tv_result.rb', line 5 def episode_imdb_id @episode_imdb_id end |
#episode_number ⇒ Object
Returns the value of attribute episode_number.
5 6 7 |
# File 'lib/videoinfo/results/tv_result.rb', line 5 def episode_number @episode_number end |
#episode_rating ⇒ Object
Returns the value of attribute episode_rating.
5 6 7 |
# File 'lib/videoinfo/results/tv_result.rb', line 5 def end |
#episode_title ⇒ Object
Returns the value of attribute episode_title.
5 6 7 |
# File 'lib/videoinfo/results/tv_result.rb', line 5 def episode_title @episode_title end |
#episode_url ⇒ Object
Returns the value of attribute episode_url.
5 6 7 |
# File 'lib/videoinfo/results/tv_result.rb', line 5 def episode_url @episode_url end |
#genres ⇒ Object
Returns the value of attribute genres.
5 6 7 |
# File 'lib/videoinfo/results/tv_result.rb', line 5 def genres @genres end |
#imdb_id ⇒ Object
Returns the value of attribute imdb_id.
5 6 7 |
# File 'lib/videoinfo/results/tv_result.rb', line 5 def imdb_id @imdb_id end |
#plot ⇒ Object
Returns the value of attribute plot.
5 6 7 |
# File 'lib/videoinfo/results/tv_result.rb', line 5 def plot @plot end |
#premiered ⇒ Object
Returns the value of attribute premiered.
5 6 7 |
# File 'lib/videoinfo/results/tv_result.rb', line 5 def premiered @premiered end |
#rating ⇒ Object
Returns the value of attribute rating.
5 6 7 |
# File 'lib/videoinfo/results/tv_result.rb', line 5 def end |
#season_number ⇒ Object
Returns the value of attribute season_number.
5 6 7 |
# File 'lib/videoinfo/results/tv_result.rb', line 5 def season_number @season_number end |
#title ⇒ Object
Returns the value of attribute title.
5 6 7 |
# File 'lib/videoinfo/results/tv_result.rb', line 5 def title @title end |
Instance Method Details
#episode_rating_over_ten ⇒ Object
11 12 13 |
# File 'lib/videoinfo/results/tv_result.rb', line 11 def ? "#{episode_rating} / 10" : nil end |
#imdb_url ⇒ Object
15 16 17 |
# File 'lib/videoinfo/results/tv_result.rb', line 15 def imdb_url imdb_id ? "http://www.imdb.com/title/tt#{imdb_id}" : nil end |
#rating_over_ten ⇒ Object
7 8 9 |
# File 'lib/videoinfo/results/tv_result.rb', line 7 def ? "#{rating} / 10" : nil end |
#to_s ⇒ Object
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 45 46 |
# File 'lib/videoinfo/results/tv_result.rb', line 19 def to_s output = ['[b]Description:[/b]', '[quote]', plot, '[/quote]', ''] output << '[b]Information:[/b]' output << '[quote]' output << "Show Name: #{title}" output << "Show url: #{imdb_url}" output << "Rating: #{rating_over_ten}" output << "Genres: #{(genres || []).join(' | ')}" output << "Country: #{country}" output << "Premiered: #{premiered}" if premiered output << "Season Number: #{season_number}" if season_number output << "Episode Number: #{episode_number}" if episode_number output << "Episode Name: #{episode_title}" if episode_title output << "Episode url: #{episode_url}" if episode_url output << "Episode Rating: #{episode_rating_over_ten}" if output << "Air Date: #{air_date}" if air_date output << '[/quote]' if screenshot_urls && screenshot_urls.size > 0 output += ['', '[b]Screenshots:[/b]', '[quote][align=center]'] output += screenshot_urls.map { |url| "[img=#{url}]" } output += ['[/align][/quote]'] end output += ['', '[mediainfo]', mediainfo, '[/mediainfo]'] output.join("\n") end |