Class: Pickpoint::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/pickpoint/config.rb

Overview

Public-api client config. Provide exactly one of api_key / client_auth / access_token.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_key: nil, client_auth: nil, access_token: nil, base_url: nil, max_retries: nil, retry_base: nil, timeout: nil, concurrency: nil, http_adapter: nil) ⇒ Config

Returns a new instance of Config.



21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/pickpoint/config.rb', line 21

def initialize(
  api_key: nil,
  client_auth: nil,
  access_token: nil,
  base_url: nil,
  max_retries: nil,
  retry_base: nil,
  timeout: nil,
  concurrency: nil,
  http_adapter: nil
)
  @api_key = api_key
  @client_auth = client_auth
  @access_token = access_token
  @base_url = base_url
  @max_retries = max_retries
  @retry_base = retry_base
  @timeout = timeout
  @concurrency = concurrency
  # Optional callable: call(method, url, headers, body) -> [status, body]
  @http_adapter = http_adapter
end

Instance Attribute Details

#access_tokenObject

Returns the value of attribute access_token.



18
19
20
# File 'lib/pickpoint/config.rb', line 18

def access_token
  @access_token
end

#api_keyObject

Returns the value of attribute api_key.



18
19
20
# File 'lib/pickpoint/config.rb', line 18

def api_key
  @api_key
end

#base_urlObject

Returns the value of attribute base_url.



18
19
20
# File 'lib/pickpoint/config.rb', line 18

def base_url
  @base_url
end

#client_authObject

Returns the value of attribute client_auth.



18
19
20
# File 'lib/pickpoint/config.rb', line 18

def client_auth
  @client_auth
end

#concurrencyObject

Returns the value of attribute concurrency.



18
19
20
# File 'lib/pickpoint/config.rb', line 18

def concurrency
  @concurrency
end

#http_adapterObject

Returns the value of attribute http_adapter.



18
19
20
# File 'lib/pickpoint/config.rb', line 18

def http_adapter
  @http_adapter
end

#max_retriesObject

Returns the value of attribute max_retries.



18
19
20
# File 'lib/pickpoint/config.rb', line 18

def max_retries
  @max_retries
end

#retry_baseObject

Returns the value of attribute retry_base.



18
19
20
# File 'lib/pickpoint/config.rb', line 18

def retry_base
  @retry_base
end

#timeoutObject

Returns the value of attribute timeout.



18
19
20
# File 'lib/pickpoint/config.rb', line 18

def timeout
  @timeout
end