class FightClub::ClumsyPlayer
Attributes
boost_factor[R]
Public Class Methods
new(name, health=100, boost_factor=1)
click to toggle source
Calls superclass method
# File lib/fightclub/clumsy_player.rb, line 7 def initialize(name, health=100, boost_factor=1) super(name, health) @boost_factor = boost_factor end
Public Instance Methods
found_treasure(treasure)
click to toggle source
to avoid duplicating code we can use super make a new Treasure object that has half points for a ClumsyPlayer
Calls superclass method
# File lib/fightclub/clumsy_player.rb, line 21 def found_treasure(treasure) trinket = Treasure.new(treasure.name, treasure.points / 2) super(trinket) end
w00t()
click to toggle source
Calls superclass method
# File lib/fightclub/clumsy_player.rb, line 26 def w00t @boost_factor.times { super } end