Module: Panmind::Recaptcha

Defined in:
lib/panmind/recaptcha.rb

Defined Under Namespace

Modules: Controller, Helpers, TestHelpers Classes: ConfigurationError

Constant Summary collapse

Version =
1.0

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.private_keyObject

Returns the value of attribute private_key.



16
17
18
# File 'lib/panmind/recaptcha.rb', line 16

def private_key
  @private_key
end

.public_keyObject

Returns the value of attribute public_key.



16
17
18
# File 'lib/panmind/recaptcha.rb', line 16

def public_key
  @public_key
end

.request_timeoutObject

Returns the value of attribute request_timeout.



16
17
18
# File 'lib/panmind/recaptcha.rb', line 16

def request_timeout
  @request_timeout
end

Class Method Details

.enabled?Boolean

Returns:

  • (Boolean)


27
28
29
# File 'lib/panmind/recaptcha.rb', line 27

def enabled?
  Rails.env.production?
end

.set(options) ⇒ Object



18
19
20
21
22
23
24
25
# File 'lib/panmind/recaptcha.rb', line 18

def set(options)
  self.private_key, self.public_key =
    options.values_at(:private_key, :public_key)

  # Defaults
  #
  self.request_timeout = options[:timeout] || 5
end