Class: TournamentSystem::DriverProxy

Inherits:
Driver
  • Object
show all
Defined in:
lib/tournament_system/driver_proxy.rb

Overview

Proxies a driver, allowing overriding of certain functions.

Used by tournament systems that build on top of others, with special behaviour. By default the behaviour is identical to the proxied driver.

Instance Method Summary collapse

Methods inherited from Driver

#count_duplicate_matches, #create_match, #create_matches, #get_match_loser, #loss_count_hash, #match_bye?, #matches_hash, #non_bye_matches, #scores_hash, #team_matches_hash

Constructor Details

#initialize(target) ⇒ DriverProxy

Returns a new instance of DriverProxy.

Parameters:

  • target (Driver)

    the driver to proxy



10
11
12
# File 'lib/tournament_system/driver_proxy.rb', line 10

def initialize(target)
  @target = target
end

Instance Method Details

#build_match(home_team, away_team) ⇒ Object



42
43
44
# File 'lib/tournament_system/driver_proxy.rb', line 42

def build_match(home_team, away_team)
  @target.build_match(home_team, away_team)
end

#get_match_teams(match) ⇒ Object



30
31
32
# File 'lib/tournament_system/driver_proxy.rb', line 30

def get_match_teams(match)
  @target.get_match_teams(match)
end

#get_match_winner(match) ⇒ Object



26
27
28
# File 'lib/tournament_system/driver_proxy.rb', line 26

def get_match_winner(match)
  @target.get_match_winner(match)
end

#get_team_matches(team) ⇒ Object



38
39
40
# File 'lib/tournament_system/driver_proxy.rb', line 38

def get_team_matches(team)
  @target.get_team_matches(team)
end

#get_team_score(team) ⇒ Object



34
35
36
# File 'lib/tournament_system/driver_proxy.rb', line 34

def get_team_score(team)
  @target.get_team_score(team)
end

#matchesObject



14
15
16
# File 'lib/tournament_system/driver_proxy.rb', line 14

def matches
  @target.matches
end

#ranked_teamsObject



22
23
24
# File 'lib/tournament_system/driver_proxy.rb', line 22

def ranked_teams
  @target.ranked_teams
end

#seeded_teamsObject



18
19
20
# File 'lib/tournament_system/driver_proxy.rb', line 18

def seeded_teams
  @target.seeded_teams
end