Class: MovieRecommender::Movie
- Inherits:
-
Object
- Object
- MovieRecommender::Movie
- Defined in:
- lib/movie_recommender/movie.rb
Constant Summary collapse
- @@all =
[]
Instance Attribute Summary collapse
-
#title ⇒ Object
Returns the value of attribute title.
-
#url ⇒ Object
Returns the value of attribute url.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(title:, url:) ⇒ Movie
constructor
A new instance of Movie.
Constructor Details
#initialize(title:, url:) ⇒ Movie
Returns a new instance of Movie.
6 7 8 9 10 |
# File 'lib/movie_recommender/movie.rb', line 6 def initialize(title:, url:) @title = title @url = url @@all << self end |
Instance Attribute Details
#title ⇒ Object
Returns the value of attribute title.
2 3 4 |
# File 'lib/movie_recommender/movie.rb', line 2 def title @title end |
#url ⇒ Object
Returns the value of attribute url.
2 3 4 |
# File 'lib/movie_recommender/movie.rb', line 2 def url @url end |
Class Method Details
.all ⇒ Object
12 13 14 |
# File 'lib/movie_recommender/movie.rb', line 12 def self.all @@all end |
.destroy ⇒ Object
16 17 18 |
# File 'lib/movie_recommender/movie.rb', line 16 def self.destroy @@all.clear end |