class Pinnacle::RequestClient
def initialize(api_key:, base_url: nil, environment: Pinnacle::Environment::DEFAULT, max_retries: nil,
-
(Pinnacle::RequestClient)
-
Parameters:
-
api_key
(String
) -- -
timeout_in_seconds
(Long
) -- -
max_retries
(Long
) -- The number of times to retry a failed request, defaults to 2. -
environment
(Pinnacle::Environment
) -- -
base_url
(String
) --
def initialize(api_key:, base_url: nil, environment: Pinnacle::Environment::DEFAULT, max_retries: nil, timeout_in_seconds: nil) @default_environment = environment @base_url = environment || base_url @api_key = api_key @conn = Faraday.new do |faraday| faraday.request :json faraday.response :raise_error, include_request: true faraday.request :retry, { max: max_retries } unless max_retries.nil? faraday.options.timeout = timeout_in_seconds unless timeout_in_seconds.nil? end end