Class: Playlist
- Inherits:
-
Object
- Object
- Playlist
- Defined in:
- lib/studio_game/movie.rb
Instance Method Summary collapse
- #add_movie(movie) ⇒ Object
-
#initialize(name) ⇒ Playlist
constructor
A new instance of Playlist.
- #play ⇒ Object
Constructor Details
#initialize(name) ⇒ Playlist
Returns a new instance of Playlist.
28 29 30 31 |
# File 'lib/studio_game/movie.rb', line 28 def initialize(name) @name = name @movies = [] end |
Instance Method Details
#add_movie(movie) ⇒ Object
33 34 35 |
# File 'lib/studio_game/movie.rb', line 33 def add_movie(movie) @movies << movie end |
#play ⇒ Object
37 38 39 40 41 42 43 44 |
# File 'lib/studio_game/movie.rb', line 37 def play puts "#{@name}'s playlist" puts @movies @movies.each do|movie| movie.thumbs_up puts movie end end |