Class: BowlingGame::Game
- Inherits:
-
Object
- Object
- BowlingGame::Game
- Defined in:
- lib/bowling_game/game.rb
Instance Attribute Summary collapse
-
#score ⇒ Object
readonly
Returns the value of attribute score.
Instance Method Summary collapse
- #add(pins) ⇒ Object
-
#initialize ⇒ Game
constructor
A new instance of Game.
Constructor Details
#initialize ⇒ Game
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
#score ⇒ Object (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 |