class MoviesAroundYou::Theater
Attributes
name[R]
Public Class Methods
all()
click to toggle source
# File lib/movies_around_you/theater.rb, line 31 def self.all @@all end
new(name)
click to toggle source
# File lib/movies_around_you/theater.rb, line 8 def initialize(name) @name = name @movies = [] @@all << self end
Public Instance Methods
add_movie(movie)
click to toggle source
# File lib/movies_around_you/theater.rb, line 18 def add_movie(movie) if !movie.is_a?(MoviesAroundYou::Movie) raise InvalidType, "Must be a Movie" end @movies << movie end
add_movie_from_collection(movie_array)
click to toggle source
# File lib/movies_around_you/theater.rb, line 25 def add_movie_from_collection(movie_array) movie_array.each do |movie| self.add_movie(movie) end end
movies()
click to toggle source
# File lib/movies_around_you/theater.rb, line 14 def movies @movies.dup.freeze end