Class: Skykick::API
- Inherits:
-
Object
- Object
- Skykick::API
- Includes:
- Authentication, Connection, WrAPI::Authentication, WrAPI::Request
- Defined in:
- lib/skykick/api.rb
Overview
The ‘Skykick::API` class manages the core configuration and settings for the API client. It allows customization of options like endpoint, user agent, and pagination handling. This class copies configuration settings from the Skykick singleton and provides methods to retrieve the client configuration.
Direct Known Subclasses
Instance Method Summary collapse
-
#config ⇒ Hash
Retrieves the current API configuration as a hash.
-
#initialize(options = {}) ⇒ Skykick::API
constructor
Initializes a new ‘Skykick::API` instance with the given options.
Methods included from Authentication
Methods included from Connection
#setup_headers, #setup_logger_filtering
Constructor Details
#initialize(options = {}) ⇒ Skykick::API
Initializes a new ‘Skykick::API` instance with the given options. The options are merged with the global Skykick settings to allow both global and per-instance customization.
25 26 27 28 29 30 31 32 33 |
# File 'lib/skykick/api.rb', line 25 def initialize( = {}) # Merge the provided options with the global Skykick configuration. = Skykick..merge() # Set each configuration key dynamically using the merged options. WrAPI::Configuration::VALID_OPTIONS_KEYS.each do |key| send("#{key}=", [key]) end end |
Instance Method Details
#config ⇒ Hash
Retrieves the current API configuration as a hash.
43 44 45 46 47 48 49 50 |
# File 'lib/skykick/api.rb', line 43 def config conf = {} # Iterate over each valid configuration key and retrieve its current value. WrAPI::Configuration::VALID_OPTIONS_KEYS.each do |key| conf[key] = send key end conf end |