Class: Scoreboard
- Inherits:
-
Object
- Object
- Scoreboard
- Defined in:
- lib/scoreboard.rb
Instance Attribute Summary collapse
-
#day ⇒ Object
Returns the value of attribute day.
-
#games ⇒ Object
An array of Game objects representing all of the games played on this date.
-
#month ⇒ Object
Returns the value of attribute month.
-
#year ⇒ Object
Returns the value of attribute year.
Instance Method Summary collapse
Instance Attribute Details
#day ⇒ Object
Returns the value of attribute day.
6 7 8 |
# File 'lib/scoreboard.rb', line 6 def day @day end |
#games ⇒ Object
An array of Game objects representing all of the games played on this date
5 6 7 |
# File 'lib/scoreboard.rb', line 5 def games @games end |
#month ⇒ Object
Returns the value of attribute month.
6 7 8 |
# File 'lib/scoreboard.rb', line 6 def month @month end |
#year ⇒ Object
Returns the value of attribute year.
6 7 8 |
# File 'lib/scoreboard.rb', line 6 def year @year end |
Instance Method Details
#load_for_date(year, month, day) ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/scoreboard.rb', line 8 def load_for_date(year, month, day) @games = [] @year = year @month = month @day = day @xml_data = GamedayFetcher.fetch_scoreboard(year, month, day) @xml_doc = REXML::Document.new(@xml_data) @xml_doc.elements.each("games/game") { |element| game = Game.new(element.attributes['gameday']) game.load_from_scoreboard(element) @games << game } end |