Class: BowlingGame::Game

Inherits:
Object
  • Object
show all
Defined in:
lib/bowling_game/game.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeGame

Returns a new instance of Game.



5
6
7
# File 'lib/bowling_game/game.rb', line 5

def initialize
  @score = 0
end

Instance Attribute Details

#scoreObject (readonly)

Returns the value of attribute score.



3
4
5
# File 'lib/bowling_game/game.rb', line 3

def score
  @score
end

Instance Method Details

#add(pins) ⇒ Object



9
10
11
# File 'lib/bowling_game/game.rb', line 9

def add(pins)
  @score = pins
end