Class: Partyhat::Player
- Inherits:
-
Object
- Object
- Partyhat::Player
- Defined in:
- lib/partyhat/player.rb
Instance Method Summary collapse
- #combat ⇒ Object
-
#initialize(name) ⇒ Player
constructor
A new instance of Player.
- #name ⇒ Object
- #stats ⇒ Object
Constructor Details
#initialize(name) ⇒ Player
Returns a new instance of Player.
6 7 8 9 |
# File 'lib/partyhat/player.rb', line 6 def initialize name @name = name @stats = Partyhat::Highscores.find_player(@name) end |
Instance Method Details
#combat ⇒ Object
19 20 21 |
# File 'lib/partyhat/player.rb', line 19 def combat Partyhat::Calculators.combat(stats) end |
#name ⇒ Object
11 12 13 |
# File 'lib/partyhat/player.rb', line 11 def name @name end |
#stats ⇒ Object
15 16 17 |
# File 'lib/partyhat/player.rb', line 15 def stats @stats end |