class CrossCrusadeOverall

Minimum three-race requirement but … should show not apply until there are at least three races

Public Class Methods

parent_name() click to toggle source
# File app/models/competitions/cross_crusade_overall.rb, line 6
def CrossCrusadeOverall.parent_name
  "Cross Crusade"
end

Public Instance Methods

create_races() click to toggle source
# File app/models/competitions/cross_crusade_overall.rb, line 10
def create_races
  races.create!(:category => Category.find_or_create_by_name("Category A"))
  races.create!(:category => Category.find_or_create_by_name("Category B"))
  races.create!(:category => Category.find_or_create_by_name("Category C"))
  races.create!(:category => Category.find_or_create_by_name("Masters 35+ A"))
  races.create!(:category => Category.find_or_create_by_name("Masters 35+ B"))
  races.create!(:category => Category.find_or_create_by_name("Masters 35+ C"))
  races.create!(:category => Category.find_or_create_by_name("Masters 50+"))
  races.create!(:category => Category.find_or_create_by_name("Masters 60+"))
  races.create!(:category => Category.find_or_create_by_name("Junior Men"))
  races.create!(:category => Category.find_or_create_by_name("Junior Women"))
  races.create!(:category => Category.find_or_create_by_name("Women A"))
  races.create!(:category => Category.find_or_create_by_name("Women B"))
  races.create!(:category => Category.find_or_create_by_name("Beginner Women"))
  races.create!(:category => Category.find_or_create_by_name("Masters Women 35+ A"))
  races.create!(:category => Category.find_or_create_by_name("Masters Women 35+ B"))
  races.create!(:category => Category.find_or_create_by_name("Masters Women 45+"))
  races.create!(:category => Category.find_or_create_by_name("Beginner Men"))
  races.create!(:category => Category.find_or_create_by_name("Singlespeed"))
  races.create!(:category => Category.find_or_create_by_name("Unicycle"))
  races.create!(:category => Category.find_or_create_by_name("Clydesdale"))
end
default_bar_points() click to toggle source
# File app/models/competitions/cross_crusade_overall.rb, line 42
def default_bar_points
  0
end
minimum_events() click to toggle source
# File app/models/competitions/cross_crusade_overall.rb, line 46
def minimum_events
  3
end
point_schedule() click to toggle source
# File app/models/competitions/cross_crusade_overall.rb, line 33
def point_schedule
  [0, 26, 20, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1]
end
points_for(source_result, team_size = nil) click to toggle source

Apply points from #point_schedule, and split across team

# File app/models/competitions/cross_crusade_overall.rb, line 38
def points_for(source_result, team_size = nil)
  point_schedule[source_result.place.to_i].to_f
end
set_name() click to toggle source
# File app/models/competitions/cross_crusade_overall.rb, line 54
def set_name
  self.name = "Series Overall"
end
set_notes() click to toggle source
# File app/models/competitions/cross_crusade_overall.rb, line 50
def set_notes
  self.notes = %Q{ Three event minimum. Results that don't meet the minimum are listed in italics. See the <a href="http://crosscrusade.com/series.html">series rules</a>. }
end