Class: SportsApi::Football::PlayerTopYellowCardResource

Inherits:
Resource
  • Object
show all
Defined in:
lib/sports_api/football/resources/players/player_top_yellow_card.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(league:, season:) ⇒ Object

Arguments: league: [Integer](required) - The league ID. season: [Integer](required) - The season of the league (= YYYY).



9
10
11
12
13
14
15
16
17
18
# File 'lib/sports_api/football/resources/players/player_top_yellow_card.rb', line 9

def list(league:, season:)
  response = get_request(
    'players/topyellowcards',
    params: {
      league: league.to_s,
      season: season.to_s
    }
  )
  Collection.from_response(response, type: SportsApi::Football::PlayerTopYellowCard)
end