Sha256: 2ceefcf1b4727380e7549e1c2646f0484b9e876a93082fd574937f51f8e27977
Contents?: true
Size: 496 Bytes
Versions: 16
Compression:
Stored size: 496 Bytes
Contents
module SportsDataApi module Nhl 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
16 entries across 16 versions & 1 rubygems