Module: RuCaptcha

Defined in:
lib/rucaptcha.rb,
lib/rucaptcha/cache.rb,
lib/rucaptcha/engine.rb,
lib/rucaptcha/captcha.rb,
lib/rucaptcha/version.rb,
lib/rucaptcha/view_helpers.rb,
lib/rucaptcha/configuration.rb,
lib/rucaptcha/controller_helpers.rb,
app/controllers/ru_captcha/captcha_controller.rb

Defined Under Namespace

Modules: Cache, ControllerHelpers, ViewHelpers Classes: Captcha, CaptchaController, Configuration, Engine

Constant Summary collapse

VERSION =
'1.0.2'

Class Method Summary collapse

Class Method Details

.configObject



14
15
16
17
18
19
20
21
22
23
24
# File 'lib/rucaptcha.rb', line 14

def config
  return @config if defined?(@config)
  @config = Configuration.new
  @config.len         = 4
  @config.font_size   = 45
  @config.implode     = 0.3
  @config.cache_limit = 100
  @config.expires_in  = 2.minutes
  @config.style       = :colorful
  @config
end

.configure(&block) ⇒ Object



26
27
28
# File 'lib/rucaptcha.rb', line 26

def configure(&block)
  config.instance_exec(&block)
end