Module: TextCaptcha

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

Defined Under Namespace

Modules: Validation, Version Classes: Config

Class Attribute Summary collapse

Class Method 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


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

def enabled
  @enabled
end

Class Method Details

.configure {|TextCaptcha::Config| ... } ⇒ Object



2
3
4
# File 'lib/text_captcha/config.rb', line 2

def self.configure(&block)
  yield TextCaptcha::Config
end