Sha256: 40aceffd8b49b352e68c2490c8a2ebc665d5cc850d20961527004a9cbebbcdbc
Contents?: true
Size: 496 Bytes
Versions: 15
Compression:
Stored size: 496 Bytes
Contents
module SportsDataApi module Nba 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
15 entries across 15 versions & 1 rubygems