class RRSchedule::Round
Attributes
cycle[RW]
flight[RW]
games[RW]
round[RW]
round_with_cycle[RW]
Public Class Methods
new(params={})
click to toggle source
# File lib/rrschedule.rb, line 407 def initialize(params={}) self.round = params[:round] self.cycle = params[:cycle] self.round_with_cycle = params[:round_with_cycle] self.flight = params[:flight] self.games = params[:games] || [] end
Public Instance Methods
to_s()
click to toggle source
# File lib/rrschedule.rb, line 415 def to_s str = "FLIGHT #{@flight.to_s} - Round ##{@round.to_s}\n" str += "=====================\n" self.games.each do |g| if [g.team_a,g.team_b].include?(:dummy) str+= g.team_a == :dummy ? g.team_b.to_s : g.team_a.to_s + " has a BYE\n" else str += g.team_a.to_s + " Vs " + g.team_b.to_s + "\n" end end str += "\n" end