Class: Mathy::Game
- Inherits:
-
Object
- Object
- Mathy::Game
- Defined in:
- lib/mathy/game.rb
Instance Method Summary collapse
-
#initialize(player, score = 0) ⇒ Game
constructor
A new instance of Game.
- #play(console) ⇒ Object
Constructor Details
#initialize(player, score = 0) ⇒ Game
Returns a new instance of Game.
3 4 5 6 |
# File 'lib/mathy/game.rb', line 3 def initialize(player, score = 0) @player = player @score = score end |
Instance Method Details
#play(console) ⇒ Object
8 9 10 11 |
# File 'lib/mathy/game.rb', line 8 def play(console) turns_played = play_turns(console) console.display_results(@player, @score, turns_played) end |