class SetGame

Model for a game

Overview

A tiebreak is a special kind of game that occurs at the end of a set

Schema Information

Table name: set_games

id               :integer          not null, primary key
ordinal          :integer          not null
match_set_id     :integer          not null
team_winner_id   :integer
created_at       :datetime         not null
updated_at       :datetime         not null
player_server_id :integer
tiebreaker       :boolean          default(FALSE), not null

Public Instance Methods

state() click to toggle source

Get the state of a game

  • Returns : symbol

    • :in_progress or

    • :finished

# File app/models/set_game.rb, line 42
def state
  team_winner_id ? :finished : :in_progress
end
tiebreak?() click to toggle source

Indicate if the game is a tiebreak

  • Returns : Boolean

# File app/models/set_game.rb, line 48
def tiebreak?
  tiebreaker
end