Class: BoxOffice::Movie
- Inherits:
-
Object
- Object
- BoxOffice::Movie
- Defined in:
- lib/box_office/movie.rb
Constant Summary collapse
- @@all =
[]
Instance Attribute Summary collapse
-
#audience_score ⇒ Object
Returns the value of attribute audience_score.
-
#cast ⇒ Object
Returns the value of attribute cast.
-
#critic_score ⇒ Object
Returns the value of attribute critic_score.
-
#director ⇒ Object
Returns the value of attribute director.
-
#genres ⇒ Object
Returns the value of attribute genres.
-
#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.
-
#studio ⇒ Object
Returns the value of attribute studio.
-
#synopsis ⇒ Object
Returns the value of attribute synopsis.
-
#title ⇒ Object
Returns the value of attribute title.
-
#writers ⇒ Object
Returns the value of attribute writers.
Class Method Summary collapse
Instance Method Summary collapse
- #add_movie_attributes(attr_hash) ⇒ Object
-
#initialize(title) ⇒ Movie
constructor
A new instance of Movie.
Constructor Details
#initialize(title) ⇒ Movie
Returns a new instance of Movie.
5 6 7 8 |
# File 'lib/box_office/movie.rb', line 5 def initialize(title) @title = title @@all << self end |
Instance Attribute Details
#audience_score ⇒ Object
Returns the value of attribute audience_score.
2 3 4 |
# File 'lib/box_office/movie.rb', line 2 def audience_score @audience_score end |
#cast ⇒ Object
Returns the value of attribute cast.
2 3 4 |
# File 'lib/box_office/movie.rb', line 2 def cast @cast end |
#critic_score ⇒ Object
Returns the value of attribute critic_score.
2 3 4 |
# File 'lib/box_office/movie.rb', line 2 def critic_score @critic_score end |
#director ⇒ Object
Returns the value of attribute director.
2 3 4 |
# File 'lib/box_office/movie.rb', line 2 def director @director end |
#genres ⇒ Object
Returns the value of attribute genres.
2 3 4 |
# File 'lib/box_office/movie.rb', line 2 def genres @genres end |
#rating ⇒ Object
Returns the value of attribute rating.
2 3 4 |
# File 'lib/box_office/movie.rb', line 2 def end |
#release_date ⇒ Object
Returns the value of attribute release_date.
2 3 4 |
# File 'lib/box_office/movie.rb', line 2 def release_date @release_date end |
#runtime ⇒ Object
Returns the value of attribute runtime.
2 3 4 |
# File 'lib/box_office/movie.rb', line 2 def runtime @runtime end |
#studio ⇒ Object
Returns the value of attribute studio.
2 3 4 |
# File 'lib/box_office/movie.rb', line 2 def studio @studio end |
#synopsis ⇒ Object
Returns the value of attribute synopsis.
2 3 4 |
# File 'lib/box_office/movie.rb', line 2 def synopsis @synopsis end |
#title ⇒ Object
Returns the value of attribute title.
2 3 4 |
# File 'lib/box_office/movie.rb', line 2 def title @title end |
#writers ⇒ Object
Returns the value of attribute writers.
2 3 4 |
# File 'lib/box_office/movie.rb', line 2 def writers @writers end |
Class Method Details
.all ⇒ Object
16 17 18 |
# File 'lib/box_office/movie.rb', line 16 def self.all @@all end |
Instance Method Details
#add_movie_attributes(attr_hash) ⇒ Object
10 11 12 13 14 |
# File 'lib/box_office/movie.rb', line 10 def add_movie_attributes(attr_hash) attr_hash.each do |key, value| self.send("#{key}=", value) end end |