lib/nhl/team.rb
# Returns all players on the team.
Returns all players on the team.
Returns all players on the team .
def roster
      response = Faraday.get("#{URL}/#{@id}?expand=team.roster")
      data = JSON.parse(response.body)
      players = []
      data['teams'][0]['roster']['roster'].each do |p|
        players << Player.new(p)
      end
      players
    end
def roster response = Faraday . get ( "#{URL}/#{@id}?expand=team.roster" ) data = JSON . parse ( response . body ) players = [ ] data [ 'teams' ] [ 0 ] [ 'roster' ] [ 'roster' ] . each do | p | players << Player . new ( p ) end players end
Returns all players on the team.
Returns all players on the team .