Class: YandexCaptcha::Configuration
- Inherits:
-
Object
- Object
- YandexCaptcha::Configuration
- Defined in:
- lib/yandex_captcha/configuration.rb
Overview
This class enables detailed configuration of the Yandex CleanWeb services.
By calling
YandexCaptcha.configuration # => instance of YandexCaptcha::Configuration
or
YandexCaptcha.configure do |config|
config # => instance of YandexCaptcha::Configuration
end
you are able to perform configuration updates.
Your are able to customize all attributes listed below. All values have sensitive default and will very likely not need to be changed.
Please note that the public and private key for the Yandex CleanWeb API Access have no useful default value. The keys may be set via the Shell enviroment or using this configuration. Settings within this configuration always take precedence.
Setting the keys with this Configuration
YandexCaptcha.configure do |config|
config.api_key = 'cw.1.1.gsdjdgskjhsdgjkgsdjsdjgkskhsgjkgsjhdkgsdghskd.sdgjhgsdsgdkjgdshkgds'
config.captcha_type = 'elite'
end
Instance Attribute Summary collapse
-
#api_key ⇒ Object
Returns the value of attribute api_key.
-
#api_server_url ⇒ Object
Returns the value of attribute api_server_url.
-
#captcha_type ⇒ Object
Returns the value of attribute captcha_type.
-
#handle_timeouts_gracefully ⇒ Object
Returns the value of attribute handle_timeouts_gracefully.
-
#skip_verify_env ⇒ Object
Returns the value of attribute skip_verify_env.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
:nodoc:.
Constructor Details
#initialize ⇒ Configuration
:nodoc:
37 38 39 40 41 42 43 |
# File 'lib/yandex_captcha/configuration.rb', line 37 def initialize #:nodoc: @api_server_url = API_URL @captcha_type = CAPTCHA_TYPE @api_key = ENV['CAPTCHA_KEY'] @skip_verify_env = SKIP_VERIFY_ENV @handle_timeouts_gracefully = HANDLE_TIMEOUTS_GRACEFULLY end |
Instance Attribute Details
#api_key ⇒ Object
Returns the value of attribute api_key.
31 32 33 |
# File 'lib/yandex_captcha/configuration.rb', line 31 def api_key @api_key end |
#api_server_url ⇒ Object
Returns the value of attribute api_server_url.
31 32 33 |
# File 'lib/yandex_captcha/configuration.rb', line 31 def api_server_url @api_server_url end |
#captcha_type ⇒ Object
Returns the value of attribute captcha_type.
31 32 33 |
# File 'lib/yandex_captcha/configuration.rb', line 31 def captcha_type @captcha_type end |
#handle_timeouts_gracefully ⇒ Object
Returns the value of attribute handle_timeouts_gracefully.
31 32 33 |
# File 'lib/yandex_captcha/configuration.rb', line 31 def handle_timeouts_gracefully @handle_timeouts_gracefully end |
#skip_verify_env ⇒ Object
Returns the value of attribute skip_verify_env.
31 32 33 |
# File 'lib/yandex_captcha/configuration.rb', line 31 def skip_verify_env @skip_verify_env end |