class Checkers::Game::State
Attributes
board[RW]
tie[RW]
turn[RW]
winner[RW]
Public Class Methods
new(turn)
click to toggle source
# File lib/checkers/game/state.rb, line 11 def initialize(turn) @board = Board.new @turn = turn @winner = nil @tie = false end
Public Instance Methods
set_state(attrs = {})
click to toggle source
# File lib/checkers/game/state.rb, line 18 def set_state(attrs = {}) changed attrs.each { |attr, value| send("#{attr}=", value) } notify_observers end