Class: SerpCheap::Rails::Configuration

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



9
10
11
12
13
14
15
16
17
# File 'lib/serpcheap/rails/configuration.rb', line 9

def initialize
  @api_key = ENV.fetch("SERPCHEAP_API_KEY", nil)
  @base_url = ENV.fetch("SERPCHEAP_BASE_URL", nil)
  @timeout_ms = 15_000
  @max_retries = 2
  @cache_enabled = true
  @cache_ttl = 3600
  @cache_store = nil
end

Instance Attribute Details

#api_keyObject

Returns the value of attribute api_key.



6
7
8
# File 'lib/serpcheap/rails/configuration.rb', line 6

def api_key
  @api_key
end

#base_urlObject

Returns the value of attribute base_url.



6
7
8
# File 'lib/serpcheap/rails/configuration.rb', line 6

def base_url
  @base_url
end

#cache_enabledObject

Returns the value of attribute cache_enabled.



6
7
8
# File 'lib/serpcheap/rails/configuration.rb', line 6

def cache_enabled
  @cache_enabled
end

#cache_storeObject

Returns the value of attribute cache_store.



6
7
8
# File 'lib/serpcheap/rails/configuration.rb', line 6

def cache_store
  @cache_store
end

#cache_ttlObject

Returns the value of attribute cache_ttl.



6
7
8
# File 'lib/serpcheap/rails/configuration.rb', line 6

def cache_ttl
  @cache_ttl
end

#max_retriesObject

Returns the value of attribute max_retries.



6
7
8
# File 'lib/serpcheap/rails/configuration.rb', line 6

def max_retries
  @max_retries
end

#timeout_msObject

Returns the value of attribute timeout_ms.



6
7
8
# File 'lib/serpcheap/rails/configuration.rb', line 6

def timeout_ms
  @timeout_ms
end