Module: TextCaptcha

Defined in:
lib/text_captcha.rb,
lib/text_captcha/version.rb,
lib/text_captcha/validation.rb

Defined Under Namespace

Modules: Validation, Version

Class Attribute Summary collapse

Class Attribute Details

.enabledObject

You can disable TextCaptcha without having to remove all validations. This is specially good when running tests.

TextCaptcha.enabled = false

class Comment
  include ActiveModel::Validations
  include TextCaptcha::Validation

  validates_captcha
end

@comment = Comment.new
@comment.valid?
#=> true


24
25
26
# File 'lib/text_captcha.rb', line 24

def enabled
  @enabled
end

.encryption_keyObject

Set the encryption key. This value will be used to generate an encrypted challenge id.



28
29
30
# File 'lib/text_captcha.rb', line 28

def encryption_key
  @encryption_key
end