lib/nhl/team.rb
# Requests a specific set of stats from the API for a team.
Requests a specific set of stats from the API for a team.
Requests a specific set of stats from the API for a team .
def stats_request(modifier, season = nil)
      response = Faraday.get("#{URL}/#{id}/stats?season=#{season}")
      stats = JSON.parse(response.body)["stats"].find do |s|
        s['type']['displayName'] == modifier
      end
      stats['splits'][0]['stat']
    end
def stats_request ( modifier , season = nil ) response = Faraday . get ( "#{URL}/#{id}/stats?season=#{season}" ) stats = JSON . parse ( response . body ) [ "stats" ] . find do | s | s [ 'type' ] [ 'displayName' ] == modifier end stats [ 'splits' ] [ 0 ] [ 'stat' ] end
Requests a specific set of stats from the API for a team.
Requests a specific set of stats from the API for a team .
modifier
<not_specific>
season
<not_specific>