class MatchPlay::WinGame
Class to help with winning games
Public Class Methods
new(match)
click to toggle source
-
Args
-
match
-> Match
-
# File app/models/concerns/match_play.rb, line 592 def initialize(match) @match = match end
Public Instance Methods
game(team)
click to toggle source
Win a normal game
# File app/models/concerns/match_play.rb, line 617 def game(team) win_game_kind team, :game end
game?()
click to toggle source
Indicate if a game can be won (a game is in progress)
# File app/models/concerns/match_play.rb, line 597 def game? win_game_kind? :game end
match_tiebreak(team)
click to toggle source
Win a tiebreak game in a match tiebreaker
# File app/models/concerns/match_play.rb, line 622 def match_tiebreak(team) win_game_kind team, :match_tiebreak end
match_tiebreak?()
click to toggle source
Indicate if a match tiebreak game can be completed (a match tiebreak is in progress)
# File app/models/concerns/match_play.rb, line 607 def match_tiebreak? win_game_kind?(:match_tiebreak) end
tiebreak(team)
click to toggle source
Win a tiebreak game at the end of a set
# File app/models/concerns/match_play.rb, line 612 def tiebreak(team) win_game_kind team, :tiebreak end
tiebreak?()
click to toggle source
Indicate if a tiebreak game can be won (a tiebreak game is in progress).
# File app/models/concerns/match_play.rb, line 602 def tiebreak? win_game_kind?(:tiebreak) end