Class: Dat::LogGame

Inherits:
Game
  • Object
show all
Defined in:
lib/dat/loggame.rb

Constant Summary

Constants inherited from Game

Game::MIN_PLAYERS, Game::START_WORD

Instance Attribute Summary

Attributes inherited from Game

#dict, #last, #logic, #min_size, #played, #used, #won

Instance Method Summary collapse

Methods inherited from Game

#display, #forfeit, #next_move!, #time, #to_s, #turn, #whos_turn

Constructor Details

#initialize(opt = {}) ⇒ LogGame

Returns a new instance of LogGame.



7
8
9
# File 'lib/dat/loggame.rb', line 7

def initialize(opt={})
  super(Logger.new.create(0), opt)
end

Instance Method Details

#play(player, word) ⇒ Object



11
12
13
14
15
# File 'lib/dat/loggame.rb', line 11

def play(player, word)
  super(player, word)
rescue Move => m
    @logger.log(m.message)
end