Class: StudioGame::Movie

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

Instance Method Summary collapse

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_downObject



18
19
20
# File 'lib/studio_game/movie.rb', line 18

def thumbs_down
  @rank -= 1
end

#thumbs_upObject



14
15
16
# File 'lib/studio_game/movie.rb', line 14

def thumbs_up
  @rank +=1
end

#to_sObject



10
11
12
# File 'lib/studio_game/movie.rb', line 10

def to_s
  puts "#{@name} has a rank of #{@rank}"
end