Class: SportsApi::Football::PlayerResource

Inherits:
Resource
  • Object
show all
Defined in:
lib/sports_api/football/resources/players/player.rb

Instance Attribute Summary

Attributes inherited from Resource

#client

Instance Method Summary collapse

Methods inherited from Resource

#get_request, #initialize

Constructor Details

This class inherits a constructor from SportsApi::Resource

Instance Method Details

#list(**params) ⇒ Object

Arguments: id: [Integer](optional) - The player ID. team: [Integer](optional) - The team ID. league: [Integer](optional) - The league ID. season: [Integer](optional) - The season of the league (= YYYY).

Requires the fields Id, League or Team

search: [String](optional) - The name of the coach (>= XXXX). page: [Integer](optional) - Use for the pagination (default: 1).



14
15
16
17
# File 'lib/sports_api/football/resources/players/player.rb', line 14

def list(**params)
  response = get_request('players', params:)
  Collection.from_response(response, type: SportsApi::Football::Player)
end