Class: RatingChgkV2::Endpoints::BaseEndpoint
- Inherits:
-
Object
- Object
- RatingChgkV2::Endpoints::BaseEndpoint
- Includes:
- Request
- Defined in:
- lib/rating_chgk_v2/endpoints/base_endpoint.rb
Direct Known Subclasses
AuthenticationTokenEndpoint, CountriesEndpoint, PlayersEndpoint, RegionsEndpoint, ReleasesEndpoint, SeasonsEndpoint, TeamsEndpoint, TournamentFlagsEndpoint, TournamentSynchAppealsEndpoint, TournamentSynchControversialsEndpoint, TournamentSynchRequestsEndpoint, TournamentTypesEndpoint, TournamentsEndpoint, TownsEndpoint, VenueTypesEndpoint, VenuesEndpoint
Constant Summary collapse
- HTTP_METHODS =
%i[get post put delete patch].freeze
Constants included from Connection
Instance Attribute Summary collapse
-
#params ⇒ Object
readonly
Returns the value of attribute params.
Instance Method Summary collapse
-
#initialize(client, query_params = [], params = {}) ⇒ BaseEndpoint
constructor
A new instance of BaseEndpoint.
- #reinitialize(new_params: {}, add_query: []) ⇒ Object
Methods included from Request
#delete, #get, #patch, #post, #put
Methods included from JsonHandler
Methods included from Connection
Constructor Details
#initialize(client, query_params = [], params = {}) ⇒ BaseEndpoint
Returns a new instance of BaseEndpoint.
12 13 14 15 |
# File 'lib/rating_chgk_v2/endpoints/base_endpoint.rb', line 12 def initialize(client, query_params = [], params = {}) @instance_query = base_query.push(*query_params) setup client, @instance_query, params end |
Instance Attribute Details
#params ⇒ Object (readonly)
Returns the value of attribute params.
8 9 10 |
# File 'lib/rating_chgk_v2/endpoints/base_endpoint.rb', line 8 def params @params end |
Instance Method Details
#reinitialize(new_params: {}, add_query: []) ⇒ Object
17 18 19 20 21 22 |
# File 'lib/rating_chgk_v2/endpoints/base_endpoint.rb', line 17 def reinitialize(new_params: {}, add_query: []) add_query = [add_query] unless add_query.is_a?(Array) new_query = add_query&.any? ? @instance_query + add_query : @query_params setup @client, new_query, new_params self end |