Module: Panmind::Recaptcha

Defined in:
lib/panmind/recaptcha.rb,
lib/panmind/recaptcha/railtie.rb

Defined Under Namespace

Modules: Controller, Helpers, TestHelpers Classes: ConfigurationError, Railtie

Constant Summary collapse

Version =
'1.0.2'

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.private_keyObject

Returns the value of attribute private_key.



18
19
20
# File 'lib/panmind/recaptcha.rb', line 18

def private_key
  @private_key
end

.public_keyObject

Returns the value of attribute public_key.



18
19
20
# File 'lib/panmind/recaptcha.rb', line 18

def public_key
  @public_key
end

.request_timeoutObject

Returns the value of attribute request_timeout.



18
19
20
# File 'lib/panmind/recaptcha.rb', line 18

def request_timeout
  @request_timeout
end

Class Method Details

.enabled?Boolean

Returns:

  • (Boolean)


29
30
31
# File 'lib/panmind/recaptcha.rb', line 29

def enabled?
  Rails.env.production? || Rails.env.development?
end

.set(options) ⇒ Object



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

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

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