class Bagel::Tennis::Player

Constants

PLAYER_ONE
PLAYER_TWO

Public Class Methods

ONE() click to toggle source
# File lib/bagel/tennis/player.rb, line 6
def self.ONE
  PLAYER_ONE
end
TWO() click to toggle source
# File lib/bagel/tennis/player.rb, line 10
def self.TWO
  PLAYER_TWO
end
index(id) click to toggle source
# File lib/bagel/tennis/player.rb, line 14
def self.index(id)
  id - 1
end
opponent(id) click to toggle source
# File lib/bagel/tennis/player.rb, line 18
def self.opponent(id)
  id == PLAYER_ONE ? PLAYER_TWO : PLAYER_ONE
end