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