Class: PrivateCaptcha::Configuration

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

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_keyObject

Returns the value of attribute api_key.



11
12
13
# File 'lib/private_captcha/configuration.rb', line 11

def api_key
  @api_key
end

#attemptsObject

Returns the value of attribute attempts.



11
12
13
# File 'lib/private_captcha/configuration.rb', line 11

def attempts
  @attempts
end

#domainObject

Returns the value of attribute domain.



11
12
13
# File 'lib/private_captcha/configuration.rb', line 11

def domain
  @domain
end

#failed_status_codeObject

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_fieldObject

Returns the value of attribute form_field.



11
12
13
# File 'lib/private_captcha/configuration.rb', line 11

def form_field
  @form_field
end

#loggerObject

Returns the value of attribute logger.



11
12
13
# File 'lib/private_captcha/configuration.rb', line 11

def logger
  @logger
end

#max_backoff_secondsObject

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