Class: BoxOffice::Movie

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

Constant Summary collapse

@@all =
[]

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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_scoreObject

Returns the value of attribute audience_score.



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

def audience_score
  @audience_score
end

#castObject

Returns the value of attribute cast.



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

def cast
  @cast
end

#critic_scoreObject

Returns the value of attribute critic_score.



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

def critic_score
  @critic_score
end

#directorObject

Returns the value of attribute director.



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

def director
  @director
end

#genresObject

Returns the value of attribute genres.



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

def genres
  @genres
end

#ratingObject

Returns the value of attribute rating.



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

def rating
  @rating
end

#release_dateObject

Returns the value of attribute release_date.



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

def release_date
  @release_date
end

#runtimeObject

Returns the value of attribute runtime.



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

def runtime
  @runtime
end

#studioObject

Returns the value of attribute studio.



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

def studio
  @studio
end

#synopsisObject

Returns the value of attribute synopsis.



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

def synopsis
  @synopsis
end

#titleObject

Returns the value of attribute title.



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

def title
  @title
end

#writersObject

Returns the value of attribute writers.



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

def writers
  @writers
end

Class Method Details

.allObject



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