Method: StudioGame::Player#initialize
- Defined in:
- lib/player_class.rb
#initialize(name, health = 100) ⇒ Player
overwrites the default method when Player.new is created! Default health is now 100.
13 14 15 16 17 |
# File 'lib/player_class.rb', line 13 def initialize(name, health=100) #overwrites the default method when Player.new is created! Default health is now 100. @name = name.capitalize @health = health @found_treasures = Hash.new(0) end |