Sha256: 3c71547c4b43abf2f1975019a50d457b860bafa48af8a086a17b2fb47fa87643
Contents?: true
Size: 507 Bytes
Versions: 22
Compression:
Stored size: 507 Bytes
Contents
module SportsDataApi module Ncaamb class Games include Enumerable attr_reader :games, :date 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 def each &block @games.each do |game| if block_given? block.call game else yield game end end end end end end
Version data entries
22 entries across 22 versions & 1 rubygems