Method: Bcpm::Tests::TestMatch#winner

Defined in:
lib/bcpm/tests/test_match.rb

#winnerObject

The side that own the game



96
97
98
99
100
101
102
103
104
105
# File 'lib/bcpm/tests/test_match.rb', line 96

def winner
  return @winner if @winner
  win_match = /\((.)\) wins/.match outcome
  @winner = if win_match
    (win_match[1] == 'A') ? :a : :b
  else
    :error
  end
  @winner
end