Class: FtcEvent::Eliminations
- Inherits:
-
Object
- Object
- FtcEvent::Eliminations
- Defined in:
- lib/ftc_event/eliminations.rb
Instance Attribute Summary collapse
-
#event ⇒ Object
readonly
Returns the value of attribute event.
Instance Method Summary collapse
- #each_match ⇒ Object
-
#initialize(event) ⇒ Eliminations
constructor
A new instance of Eliminations.
- #match(match_number) ⇒ Object
- #matches ⇒ Object
- #name ⇒ Object
Constructor Details
#initialize(event) ⇒ Eliminations
Returns a new instance of Eliminations.
7 8 9 |
# File 'lib/ftc_event/eliminations.rb', line 7 def initialize(event) @event = event end |
Instance Attribute Details
#event ⇒ Object (readonly)
Returns the value of attribute event.
5 6 7 |
# File 'lib/ftc_event/eliminations.rb', line 5 def event @event end |
Instance Method Details
#each_match ⇒ Object
23 24 25 26 27 28 29 30 31 |
# File 'lib/ftc_event/eliminations.rb', line 23 def each_match return enum_for(:each_match) unless block_given? matches.each do |match_number| yield match(match_number) end nil end |
#match(match_number) ⇒ Object
15 16 17 |
# File 'lib/ftc_event/eliminations.rb', line 15 def match(match_number) Elimination.new(event, match_number) end |
#matches ⇒ Object
19 20 21 |
# File 'lib/ftc_event/eliminations.rb', line 19 def matches event.db.query('SELECT match FROM elims').map { |row| row['match'] } end |
#name ⇒ Object
11 12 13 |
# File 'lib/ftc_event/eliminations.rb', line 11 def name 'Eliminations' end |