class SportsDataApi::Nba::Games

Attributes

date[R]
json[R]

Public Class Methods

new(json) click to toggle source
# File lib/sports_data_api/nba/games.rb, line 8
def initialize(json)
  @json = json
  @date = json['date']
end

Public Instance Methods

each() { |game| ... } click to toggle source
# File lib/sports_data_api/nba/games.rb, line 19
def each
  return games.each unless block_given?
  games.each { |game| yield game }
end
games() click to toggle source
# File lib/sports_data_api/nba/games.rb, line 13
def games
  @games ||= json.fetch('games', []).map do |game_json|
    Game.new(json: game_json)
  end
end