class SportsDataApi::Ncaamb::Games
Attributes
date[R]
games[R]
Public Class Methods
new(xml)
click to toggle source
# File lib/sports_data_api/ncaamb/games.rb, line 7 def initialize(xml) @date = xml.first['date'] @games = xml.xpath("games/game").map do |game_xml| Game.new(date: @date, xml: game_xml) end end
Public Instance Methods
each() { |game| ... }
click to toggle source
# File lib/sports_data_api/ncaamb/games.rb, line 15 def each &block @games.each do |game| if block_given? block.call game else yield game end end end