Class: StudioGame::Movie
- Inherits:
-
Object
- Object
- StudioGame::Movie
- Defined in:
- lib/studio_game/movie.rb
Instance Method Summary collapse
-
#initialize(name, rank) ⇒ Movie
constructor
A new instance of Movie.
- #thumbs_down ⇒ Object
- #thumbs_up ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(name, rank) ⇒ Movie
Returns a new instance of Movie.
5 6 7 8 |
# File 'lib/studio_game/movie.rb', line 5 def initialize(name,rank) @name = name.capitalize @rank = rank end |
Instance Method Details
#thumbs_down ⇒ Object
18 19 20 |
# File 'lib/studio_game/movie.rb', line 18 def thumbs_down @rank -= 1 end |
#thumbs_up ⇒ Object
14 15 16 |
# File 'lib/studio_game/movie.rb', line 14 def thumbs_up @rank +=1 end |
#to_s ⇒ Object
10 11 12 |
# File 'lib/studio_game/movie.rb', line 10 def to_s puts "#{@name} has a rank of #{@rank}" end |