class FReCon::Team

Public: The Team model.

Public Class Methods

number(team_number) click to toggle source

Public: Find a team by number.

team_number - An Integer to be used to compare.

Returns a Team if one exists with the given number, otherwise nil.

# File lib/frecon/models/team.rb, line 31
def self.number(team_number)
        find_by number: team_number
end
Also aliased as: with_number, that_has_number
that_has_number(team_number)
Alias for: number
with_number(team_number)
Alias for: number

Public Instance Methods

competitions() click to toggle source

Public: Get this Team's Robots' Participations' Competitions

# File lib/frecon/models/team.rb, line 41
def competitions
        Competition.in id: participations.map(&:competition_id)
end
matches() click to toggle source

Public: Get this Team's Robots' Participations' Competitions' Matches

# File lib/frecon/models/team.rb, line 51
def matches
        Match.in competition_id: competitions.map(&:id)
end
participations() click to toggle source

Public: Get this Team's Robots' Participations

# File lib/frecon/models/team.rb, line 36
def participations
        Participation.in robot_id: robots.map(&:id)
end
records() click to toggle source

Public: Get this Team's Robots' Participations' Records

# File lib/frecon/models/team.rb, line 46
def records
        Record.in participation_id: participations.map(&:id)
end