Class: RRSchedule::Round
- Inherits:
-
Object
- Object
- RRSchedule::Round
- Defined in:
- lib/rrschedule.rb
Instance Attribute Summary collapse
-
#cycle ⇒ Object
Returns the value of attribute cycle.
-
#flight ⇒ Object
Returns the value of attribute flight.
-
#games ⇒ Object
Returns the value of attribute games.
-
#round ⇒ Object
Returns the value of attribute round.
-
#round_with_cycle ⇒ Object
Returns the value of attribute round_with_cycle.
Instance Method Summary collapse
-
#initialize(params = {}) ⇒ Round
constructor
A new instance of Round.
- #to_s ⇒ Object
Constructor Details
#initialize(params = {}) ⇒ Round
Returns a new instance of Round.
407 408 409 410 411 412 413 |
# 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 |
Instance Attribute Details
#cycle ⇒ Object
Returns the value of attribute cycle.
405 406 407 |
# File 'lib/rrschedule.rb', line 405 def cycle @cycle end |
#flight ⇒ Object
Returns the value of attribute flight.
405 406 407 |
# File 'lib/rrschedule.rb', line 405 def flight @flight end |
#games ⇒ Object
Returns the value of attribute games.
405 406 407 |
# File 'lib/rrschedule.rb', line 405 def games @games end |
#round ⇒ Object
Returns the value of attribute round.
405 406 407 |
# File 'lib/rrschedule.rb', line 405 def round @round end |
#round_with_cycle ⇒ Object
Returns the value of attribute round_with_cycle.
405 406 407 |
# File 'lib/rrschedule.rb', line 405 def round_with_cycle @round_with_cycle end |
Instance Method Details
#to_s ⇒ Object
415 416 417 418 419 420 421 422 423 424 425 426 427 |
# 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 |