Class: Rotten_tomatoes::Movie
- Inherits:
-
Object
- Object
- Rotten_tomatoes::Movie
- Defined in:
- lib/rotten-tomatoes.rb
Overview
Rotten_tomatoes::Movie is a class that organizes the scraped information about the movie into easily accessible attribues.
Instance Attribute Summary collapse
-
#audience_average_rating ⇒ Object
readonly
Returns the value of attribute audience_average_rating.
-
#audience_number_of_ratings ⇒ Object
readonly
Returns the value of attribute audience_number_of_ratings.
-
#audience_rating ⇒ Object
readonly
Returns the value of attribute audience_rating.
-
#cast ⇒ Object
readonly
Returns the value of attribute cast.
-
#directors ⇒ Object
readonly
Returns the value of attribute directors.
-
#distributor ⇒ Object
readonly
Returns the value of attribute distributor.
-
#genres ⇒ Object
readonly
Returns the value of attribute genres.
-
#info_page ⇒ Object
readonly
Returns the value of attribute info_page.
-
#people ⇒ Object
readonly
Returns the value of attribute people.
-
#rating ⇒ Object
readonly
Returns the value of attribute rating.
-
#release ⇒ Object
readonly
Returns the value of attribute release.
-
#runtime ⇒ Object
readonly
Returns the value of attribute runtime.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
-
#tomatometer ⇒ Object
readonly
Returns the value of attribute tomatometer.
-
#tomatometer_average_rating ⇒ Object
readonly
Returns the value of attribute tomatometer_average_rating.
-
#tomatometer_fresh ⇒ Object
readonly
Returns the value of attribute tomatometer_fresh.
-
#tomatometer_reviews_counted ⇒ Object
readonly
Returns the value of attribute tomatometer_reviews_counted.
-
#tomatometer_rotten ⇒ Object
readonly
Returns the value of attribute tomatometer_rotten.
-
#writers ⇒ Object
readonly
Returns the value of attribute writers.
-
#year ⇒ Object
readonly
Returns the value of attribute year.
Instance Method Summary collapse
- #director ⇒ Object
-
#initialize(movie_url) ⇒ Movie
constructor
A new instance of Movie.
- #writer ⇒ Object
Constructor Details
#initialize(movie_url) ⇒ Movie
Returns a new instance of Movie.
77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 |
# File 'lib/rotten-tomatoes.rb', line 77 def initialize movie_url @info_page = Nokogiri::HTML(open(URI.parse(Rotten_tomatoes::Base_url + movie_url))) if @info_page set_title_and_year set_cast set_writers set_directors set_people set_runtime set_tomatometer set_tomatometer_reviews_counted set_tomatometer_fresh_and_rotten set_genres set_release set_distributor end @info_page = nil return self end |
Instance Attribute Details
#audience_average_rating ⇒ Object (readonly)
Returns the value of attribute audience_average_rating.
75 76 77 |
# File 'lib/rotten-tomatoes.rb', line 75 def @audience_average_rating end |
#audience_number_of_ratings ⇒ Object (readonly)
Returns the value of attribute audience_number_of_ratings.
75 76 77 |
# File 'lib/rotten-tomatoes.rb', line 75 def @audience_number_of_ratings end |
#audience_rating ⇒ Object (readonly)
Returns the value of attribute audience_rating.
75 76 77 |
# File 'lib/rotten-tomatoes.rb', line 75 def @audience_rating end |
#cast ⇒ Object (readonly)
Returns the value of attribute cast.
75 76 77 |
# File 'lib/rotten-tomatoes.rb', line 75 def cast @cast end |
#directors ⇒ Object (readonly)
Returns the value of attribute directors.
75 76 77 |
# File 'lib/rotten-tomatoes.rb', line 75 def directors @directors end |
#distributor ⇒ Object (readonly)
Returns the value of attribute distributor.
75 76 77 |
# File 'lib/rotten-tomatoes.rb', line 75 def distributor @distributor end |
#genres ⇒ Object (readonly)
Returns the value of attribute genres.
75 76 77 |
# File 'lib/rotten-tomatoes.rb', line 75 def genres @genres end |
#info_page ⇒ Object (readonly)
Returns the value of attribute info_page.
75 76 77 |
# File 'lib/rotten-tomatoes.rb', line 75 def info_page @info_page end |
#people ⇒ Object (readonly)
Returns the value of attribute people.
75 76 77 |
# File 'lib/rotten-tomatoes.rb', line 75 def people @people end |
#rating ⇒ Object (readonly)
Returns the value of attribute rating.
75 76 77 |
# File 'lib/rotten-tomatoes.rb', line 75 def @rating end |
#release ⇒ Object (readonly)
Returns the value of attribute release.
75 76 77 |
# File 'lib/rotten-tomatoes.rb', line 75 def release @release end |
#runtime ⇒ Object (readonly)
Returns the value of attribute runtime.
75 76 77 |
# File 'lib/rotten-tomatoes.rb', line 75 def runtime @runtime end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
75 76 77 |
# File 'lib/rotten-tomatoes.rb', line 75 def title @title end |
#tomatometer ⇒ Object (readonly)
Returns the value of attribute tomatometer.
75 76 77 |
# File 'lib/rotten-tomatoes.rb', line 75 def tomatometer @tomatometer end |
#tomatometer_average_rating ⇒ Object (readonly)
Returns the value of attribute tomatometer_average_rating.
75 76 77 |
# File 'lib/rotten-tomatoes.rb', line 75 def @tomatometer_average_rating end |
#tomatometer_fresh ⇒ Object (readonly)
Returns the value of attribute tomatometer_fresh.
75 76 77 |
# File 'lib/rotten-tomatoes.rb', line 75 def tomatometer_fresh @tomatometer_fresh end |
#tomatometer_reviews_counted ⇒ Object (readonly)
Returns the value of attribute tomatometer_reviews_counted.
75 76 77 |
# File 'lib/rotten-tomatoes.rb', line 75 def tomatometer_reviews_counted @tomatometer_reviews_counted end |
#tomatometer_rotten ⇒ Object (readonly)
Returns the value of attribute tomatometer_rotten.
75 76 77 |
# File 'lib/rotten-tomatoes.rb', line 75 def tomatometer_rotten @tomatometer_rotten end |
#writers ⇒ Object (readonly)
Returns the value of attribute writers.
75 76 77 |
# File 'lib/rotten-tomatoes.rb', line 75 def writers @writers end |
#year ⇒ Object (readonly)
Returns the value of attribute year.
75 76 77 |
# File 'lib/rotten-tomatoes.rb', line 75 def year @year end |
Instance Method Details
#director ⇒ Object
204 205 206 |
# File 'lib/rotten-tomatoes.rb', line 204 def director @directors.first end |
#writer ⇒ Object
208 209 210 |
# File 'lib/rotten-tomatoes.rb', line 208 def writer @writers.first end |