Class: Videoinfo::Results::MovieResult
- Inherits:
-
Videoinfo::Result
- Object
- Videoinfo::Result
- Videoinfo::Results::MovieResult
- Defined in:
- lib/videoinfo/results/movie_result.rb
Instance Attribute Summary collapse
-
#director ⇒ Object
Returns the value of attribute director.
-
#genres ⇒ Object
Returns the value of attribute genres.
-
#imdb_id ⇒ Object
Returns the value of attribute imdb_id.
-
#plot_summary ⇒ Object
Returns the value of attribute plot_summary.
-
#rating ⇒ Object
Returns the value of attribute rating.
-
#release_date ⇒ Object
Returns the value of attribute release_date.
-
#runtime ⇒ Object
Returns the value of attribute runtime.
-
#title ⇒ Object
Returns the value of attribute title.
-
#trailer_url ⇒ Object
Returns the value of attribute trailer_url.
-
#wiki_url ⇒ Object
Returns the value of attribute wiki_url.
-
#writers ⇒ Object
Returns the value of attribute writers.
Attributes inherited from Videoinfo::Result
Instance Method Summary collapse
Instance Attribute Details
#director ⇒ Object
Returns the value of attribute director.
5 6 7 |
# File 'lib/videoinfo/results/movie_result.rb', line 5 def director @director end |
#genres ⇒ Object
Returns the value of attribute genres.
5 6 7 |
# File 'lib/videoinfo/results/movie_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/movie_result.rb', line 5 def imdb_id @imdb_id end |
#plot_summary ⇒ Object
Returns the value of attribute plot_summary.
5 6 7 |
# File 'lib/videoinfo/results/movie_result.rb', line 5 def plot_summary @plot_summary end |
#rating ⇒ Object
Returns the value of attribute rating.
5 6 7 |
# File 'lib/videoinfo/results/movie_result.rb', line 5 def @rating end |
#release_date ⇒ Object
Returns the value of attribute release_date.
5 6 7 |
# File 'lib/videoinfo/results/movie_result.rb', line 5 def release_date @release_date end |
#runtime ⇒ Object
Returns the value of attribute runtime.
5 6 7 |
# File 'lib/videoinfo/results/movie_result.rb', line 5 def runtime @runtime end |
#title ⇒ Object
Returns the value of attribute title.
5 6 7 |
# File 'lib/videoinfo/results/movie_result.rb', line 5 def title @title end |
#trailer_url ⇒ Object
Returns the value of attribute trailer_url.
5 6 7 |
# File 'lib/videoinfo/results/movie_result.rb', line 5 def trailer_url @trailer_url end |
#wiki_url ⇒ Object
Returns the value of attribute wiki_url.
5 6 7 |
# File 'lib/videoinfo/results/movie_result.rb', line 5 def wiki_url @wiki_url end |
#writers ⇒ Object
Returns the value of attribute writers.
5 6 7 |
# File 'lib/videoinfo/results/movie_result.rb', line 5 def writers @writers end |
Instance Method Details
#imdb_url ⇒ Object
11 12 13 |
# File 'lib/videoinfo/results/movie_result.rb', line 11 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/movie_result.rb', line 7 def ? "#{} / 10" : nil end |
#to_s ⇒ Object
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/videoinfo/results/movie_result.rb', line 15 def to_s output = ['[b]Description:[/b]', '[quote]', plot_summary, '[/quote]', ''] output << '[b]Information:[/b]' output << '[quote]' output << "Title: #{title}" output << "Rating: #{}" output << "Release Date: #{release_date}" output << "Genres: #{(genres || []).join(' | ')}" output << "Director: #{director}" if director output << "Writers: #{writers.join(', ')}" if writers && writers.size > 0 output << "Runtime: #{runtime} minutes" if runtime output << "Wikipedia url: #{wiki_url}" if wiki_url output << "IDMB url: #{imdb_url}" output << '[/quote]' if trailer_url output += ['', '[b]Trailer:[/b]', '[quote]', "[center][youtube]#{trailer_url}[/youtube][/center]", '[/quote]'] end 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 |