Class: PrivateCaptcha::Configuration
- Inherits:
-
Object
- Object
- PrivateCaptcha::Configuration
- Defined in:
- lib/private_captcha/configuration.rb
Overview
Configuration holds the settings for the Private Captcha client
Constant Summary collapse
- GLOBAL_DOMAIN =
'api.privatecaptcha.com'- EU_DOMAIN =
'api.eu.privatecaptcha.com'- DEFAULT_FORM_FIELD =
'private-captcha-solution'- DEFAULT_FAILED_STATUS_CODE =
403
Instance Attribute Summary collapse
-
#api_key ⇒ Object
Returns the value of attribute api_key.
-
#attempts ⇒ Object
Returns the value of attribute attempts.
-
#domain ⇒ Object
Returns the value of attribute domain.
-
#failed_status_code ⇒ Object
Returns the value of attribute failed_status_code.
-
#form_field ⇒ Object
Returns the value of attribute form_field.
-
#logger ⇒ Object
Returns the value of attribute logger.
-
#max_backoff_seconds ⇒ Object
Returns the value of attribute max_backoff_seconds.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
14 15 16 17 18 19 20 21 22 |
# File 'lib/private_captcha/configuration.rb', line 14 def initialize @domain = GLOBAL_DOMAIN @api_key = nil @form_field = DEFAULT_FORM_FIELD @failed_status_code = DEFAULT_FAILED_STATUS_CODE @max_backoff_seconds = 20 @attempts = 5 @logger = nil end |
Instance Attribute Details
#api_key ⇒ Object
Returns the value of attribute api_key.
11 12 13 |
# File 'lib/private_captcha/configuration.rb', line 11 def api_key @api_key end |
#attempts ⇒ Object
Returns the value of attribute attempts.
11 12 13 |
# File 'lib/private_captcha/configuration.rb', line 11 def attempts @attempts end |
#domain ⇒ Object
Returns the value of attribute domain.
11 12 13 |
# File 'lib/private_captcha/configuration.rb', line 11 def domain @domain end |
#failed_status_code ⇒ Object
Returns the value of attribute failed_status_code.
11 12 13 |
# File 'lib/private_captcha/configuration.rb', line 11 def failed_status_code @failed_status_code end |
#form_field ⇒ Object
Returns the value of attribute form_field.
11 12 13 |
# File 'lib/private_captcha/configuration.rb', line 11 def form_field @form_field end |
#logger ⇒ Object
Returns the value of attribute logger.
11 12 13 |
# File 'lib/private_captcha/configuration.rb', line 11 def logger @logger end |
#max_backoff_seconds ⇒ Object
Returns the value of attribute max_backoff_seconds.
11 12 13 |
# File 'lib/private_captcha/configuration.rb', line 11 def max_backoff_seconds @max_backoff_seconds end |