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