Class: Mathy::Game

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

Instance Method Summary collapse

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