Class: Vindi::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/vindi/configuration.rb

Constant Summary collapse

DEFAULT_API_URL =
"https://sandbox-gp.vindi.com.br/api/v1"

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



10
11
12
13
14
15
16
17
18
19
# File 'lib/vindi/configuration.rb', line 10

def initialize
  @api_key = nil
  @api_url = DEFAULT_API_URL
  @cache_store = nil
  @cache_ttl = 300
  @cached_resources = %i[plans products discounts payment_methods]
  @max_retries = 3
  @retry_backoff_factor = 2
  @retry_base_delay = 1.0
end

Instance Attribute Details

#api_keyObject

Returns the value of attribute api_key.



5
6
7
# File 'lib/vindi/configuration.rb', line 5

def api_key
  @api_key
end

#api_urlObject

Returns the value of attribute api_url.



5
6
7
# File 'lib/vindi/configuration.rb', line 5

def api_url
  @api_url
end

#cache_storeObject

Returns the value of attribute cache_store.



5
6
7
# File 'lib/vindi/configuration.rb', line 5

def cache_store
  @cache_store
end

#cache_ttlObject

Returns the value of attribute cache_ttl.



5
6
7
# File 'lib/vindi/configuration.rb', line 5

def cache_ttl
  @cache_ttl
end

#cached_resourcesObject

Returns the value of attribute cached_resources.



5
6
7
# File 'lib/vindi/configuration.rb', line 5

def cached_resources
  @cached_resources
end

#max_retriesObject

Returns the value of attribute max_retries.



5
6
7
# File 'lib/vindi/configuration.rb', line 5

def max_retries
  @max_retries
end

#retry_backoff_factorObject

Returns the value of attribute retry_backoff_factor.



5
6
7
# File 'lib/vindi/configuration.rb', line 5

def retry_backoff_factor
  @retry_backoff_factor
end

#retry_base_delayObject

Returns the value of attribute retry_base_delay.



5
6
7
# File 'lib/vindi/configuration.rb', line 5

def retry_base_delay
  @retry_base_delay
end