Sha256: d77be376bfb45dd81fb61b004a2536347eb8fcd693c68e1ea971e379a721abe1
Contents?: true
Size: 486 Bytes
Versions: 5
Compression:
Stored size: 486 Bytes
Contents
module SportsDataApi module Nhl class Games include Enumerable attr_reader :date def initialize(json) @json = json @date = json['date'] end def games @games ||= json['games'].map do |game_json| Game.new(json: game_json) end end def each return games.each unless block_given? games.each { |game| yield game } end private attr_reader :json end end end
Version data entries
5 entries across 5 versions & 1 rubygems