Class: Pangea::Client
- Inherits:
-
Internal::Transport::BaseClient
- Object
- Internal::Transport::BaseClient
- Pangea::Client
- Defined in:
- lib/pangea/client.rb
Constant Summary collapse
- DEFAULT_TIMEOUT_IN_SECONDS =
Default per-request timeout.
600.0- DEFAULT_MAX_RETRIES =
Default max number of retries to attempt after a failed retryable request.
2- DEFAULT_INITIAL_RETRY_DELAY =
Default initial retry delay in seconds. Overall delay is calculated using exponential backoff + jitter.
0.5
Constants inherited from Internal::Transport::BaseClient
Internal::Transport::BaseClient::PLATFORM_HEADERS
Instance Attribute Summary collapse
- #api_token ⇒ String readonly
Attributes inherited from Internal::Transport::BaseClient
Instance Method Summary collapse
-
#initialize(api_token:, base_url:, initial_retry_delay: DEFAULT_INITIAL_RETRY_DELAY, max_retries: DEFAULT_MAX_RETRIES, timeout: DEFAULT_TIMEOUT_IN_SECONDS) ⇒ Client
constructor
Creates and returns a new client for interacting with the Pangea API.
Methods inherited from Internal::Transport::BaseClient
reap_connection!, #request, validate!
Constructor Details
#initialize(api_token:, base_url:, initial_retry_delay: DEFAULT_INITIAL_RETRY_DELAY, max_retries: DEFAULT_MAX_RETRIES, timeout: DEFAULT_TIMEOUT_IN_SECONDS) ⇒ Client
Creates and returns a new client for interacting with the Pangea API.
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/pangea/client.rb', line 33 def initialize( api_token:, base_url:, initial_retry_delay: DEFAULT_INITIAL_RETRY_DELAY, max_retries: DEFAULT_MAX_RETRIES, timeout: DEFAULT_TIMEOUT_IN_SECONDS ) @api_token = api_token&.to_s super( base_url: base_url, initial_retry_delay: initial_retry_delay, max_retries: max_retries, headers: {}, timeout: timeout ) end |
Instance Attribute Details
#api_token ⇒ String (readonly)
16 17 18 |
# File 'lib/pangea/client.rb', line 16 def api_token @api_token end |