Class: MovieRecommender::Movie

Inherits:
Object
  • Object
show all
Defined in:
lib/movie_recommender/movie.rb

Constant Summary collapse

@@all =
[]

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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

#titleObject

Returns the value of attribute title.



2
3
4
# File 'lib/movie_recommender/movie.rb', line 2

def title
  @title
end

#urlObject

Returns the value of attribute url.



2
3
4
# File 'lib/movie_recommender/movie.rb', line 2

def url
  @url
end

Class Method Details

.allObject



12
13
14
# File 'lib/movie_recommender/movie.rb', line 12

def self.all
  @@all
end

.destroyObject



16
17
18
# File 'lib/movie_recommender/movie.rb', line 16

def self.destroy
  @@all.clear
end