Class: SerpCheap::Rails::Configuration
- Inherits:
-
Object
- Object
- SerpCheap::Rails::Configuration
- Defined in:
- lib/serpcheap/rails/configuration.rb
Instance Attribute Summary collapse
-
#api_key ⇒ Object
Returns the value of attribute api_key.
-
#base_url ⇒ Object
Returns the value of attribute base_url.
-
#cache_enabled ⇒ Object
Returns the value of attribute cache_enabled.
-
#cache_store ⇒ Object
Returns the value of attribute cache_store.
-
#cache_ttl ⇒ Object
Returns the value of attribute cache_ttl.
-
#max_retries ⇒ Object
Returns the value of attribute max_retries.
-
#timeout_ms ⇒ Object
Returns the value of attribute timeout_ms.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
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_key ⇒ Object
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_url ⇒ Object
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_enabled ⇒ Object
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_store ⇒ Object
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_ttl ⇒ Object
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_retries ⇒ Object
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_ms ⇒ Object
Returns the value of attribute timeout_ms.
6 7 8 |
# File 'lib/serpcheap/rails/configuration.rb', line 6 def timeout_ms @timeout_ms end |