lib/nhl/game.rb
# Retrieves games for a specific date.
Retrieves games for a specific date.
Retrieves games for a specific date .
def games_on_date(date)
        response = Faraday.get("#{URL}?date=#{date}")
        data = JSON.parse(response.body)
        dates = data['dates']
        if dates.empty?
          []
        else
          dates[0]['games'].map do |g| new(g) end
        end
      end
def games_on_date ( date ) response = Faraday . get ( "#{URL}?date=#{date}" ) data = JSON . parse ( response . body ) dates = data [ 'dates' ] if dates . empty? [ ] else dates [ 0 ] [ 'games' ] . map do | g | new ( g ) end end end
Retrieves games for a specific date.
Retrieves games for a specific date .
date
<not_specific>