Class: SportsApi::Resource
- Inherits:
-
Object
- Object
- SportsApi::Resource
- Defined in:
- lib/sports_api/resource.rb
Direct Known Subclasses
Football::CoachResource, Football::CountryResource, Football::FixtureEventResource, Football::FixtureHeadToHeadResource, Football::FixtureLineupResource, Football::FixturePlayerStatisticResource, Football::FixtureResource, Football::FixtureRoundResource, Football::FixtureStatisticResource, Football::InjuryResource, Football::LeagueResource, Football::LeagueSeasonResource, Football::OddsBetResource, Football::OddsBookmakerResource, Football::OddsLiveBetResource, Football::OddsLiveResource, Football::OddsMappingResource, Football::OddsResource, Football::PlayerResource, Football::PlayerSeasonResource, Football::PlayerSquadResource, Football::PlayerTopAssistResource, Football::PlayerTopRedCardResource, Football::PlayerTopScorerResource, Football::PlayerTopYellowCardResource, Football::PredictionResource, Football::SidelinedResource, Football::StandingResource, Football::TeamCountryResource, Football::TeamResource, Football::TeamSeasonResource, Football::TeamStatisticResource, Football::TimezoneResource, Football::TransferResource, Football::TrophyResource, Football::VenueResource
Instance Attribute Summary collapse
-
#client ⇒ Object
readonly
Returns the value of attribute client.
Instance Method Summary collapse
- #get_request(path, params: {}, headers: {}) ⇒ Object
-
#initialize(client) ⇒ Resource
constructor
A new instance of Resource.
Constructor Details
#initialize(client) ⇒ Resource
Returns a new instance of Resource.
7 8 9 |
# File 'lib/sports_api/resource.rb', line 7 def initialize(client) @client = client end |
Instance Attribute Details
#client ⇒ Object (readonly)
Returns the value of attribute client.
5 6 7 |
# File 'lib/sports_api/resource.rb', line 5 def client @client end |
Instance Method Details
#get_request(path, params: {}, headers: {}) ⇒ Object
11 12 13 |
# File 'lib/sports_api/resource.rb', line 11 def get_request(path, params: {}, headers: {}) handle_response(client.connection.get(path, params, default_headers.merge(headers))) end |