Class: SportsApi::Football::CoachResource
- Defined in:
- lib/sports_api/football/resources/coach.rb
Instance Attribute Summary
Attributes inherited from Resource
Instance Method Summary collapse
- #find(id:) ⇒ Object
-
#list(**params) ⇒ Object
Arguments: id: [Integer](optional) - The coach ID.
Methods inherited from Resource
Constructor Details
This class inherits a constructor from SportsApi::Resource
Instance Method Details
#find(id:) ⇒ Object
15 16 17 18 |
# File 'lib/sports_api/football/resources/coach.rb', line 15 def find(id:) response = get_request('coachs', params: { id: id.to_s }) SportsApi::Football::Coach.new(response.body['response'][0]) end |
#list(**params) ⇒ Object
Arguments: id: [Integer](optional) - The coach ID. team: [Integer](optional) - The team ID. search: [String](optional) - The name of the coach (>= XXX).
10 11 12 13 |
# File 'lib/sports_api/football/resources/coach.rb', line 10 def list(**params) response = get_request('coachs', params:) Collection.from_response(response, type: SportsApi::Football::Coach) end |