Module: Captchah

Defined in:
lib/captchah.rb,
lib/captchah/version.rb,
lib/captchah/verifier.rb,
lib/captchah/encryptor.rb,
lib/captchah/base64_images.rb,
lib/captchah/generators/html.rb,
lib/captchah/generators/truth.rb,
lib/captchah/generators/puzzle.rb,
lib/captchah/generators/captcha.rb,
app/controllers/captchah/captchah_controller.rb

Defined Under Namespace

Modules: Generators Classes: Base64Images, CaptchahController, Encryptor, Engine, Error, Verifier

Constant Summary collapse

VERSION =
'3.0.0'

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



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

def self.included(base)
  return unless base.respond_to?(:helper_method)

  return unless base.ancestors.include?(ActionController::Base)

  base.helper_method(:captchah_tag, :verify_captchah)
end

Instance Method Details

#captchah_tag(*args) ⇒ Object



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

def captchah_tag(*args)
  Generators::Captcha.call(*args)
end

#verify_captchahObject



31
32
33
# File 'lib/captchah.rb', line 31

def verify_captchah
  Verifier.call(params[:captchah])
end