Tournament::ScoringStrategy

Module namespace for various scoring strategies for tournament pools.

Public Class Methods

available_strategies() click to toggle source

Returns names of available strategies. The names returned are suitable for use in the strategy_for_name method

    # File lib/tournament/scoring_strategy.rb, line 92
92:   def self.available_strategies
93:     return ['basic', 'upset', 'josh_patashnik', 'tweaked_josh_patashnik', 'constant_value']
94:   end
strategy_for_name(name) click to toggle source

Returns an instantiated strategy class for the named strategy.

     # File lib/tournament/scoring_strategy.rb, line 97
 97:   def self.strategy_for_name(name)
 98:     clazz = Tournament::ScoringStrategy.const_get(name.capitalize.gsub(/_([a-zA-Z])/) {|m| $1.upcase})
 99:     return clazz.new
100:   end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.