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
-
.enabled ⇒ Object
You can disable TextCaptcha without having to remove all validations.
-
.encryption_key ⇒ Object
Set the encryption key.
Class Attribute Details
.enabled ⇒ Object
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_key ⇒ Object
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 |