Class: LemonadeStand::Player

Inherits:
Object
  • Object
show all
Defined in:
lib/lemonade_stand/player.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializePlayer

Returns a new instance of Player.



8
9
10
# File 'lib/lemonade_stand/player.rb', line 8

def initialize
  @assets = 200
end

Instance Attribute Details

#assetsObject

Returns the value of attribute assets.



6
7
8
# File 'lib/lemonade_stand/player.rb', line 6

def assets
  @assets
end

#gameObject

Returns the value of attribute game.



5
6
7
# File 'lib/lemonade_stand/player.rb', line 5

def game
  @game
end

#indexObject

Returns the value of attribute index.



4
5
6
# File 'lib/lemonade_stand/player.rb', line 4

def index
  @index
end

Instance Method Details

#choose(choice) ⇒ Object



12
13
14
# File 'lib/lemonade_stand/player.rb', line 12

def choose choice
  game.make_choice choice, { player: self }
end