Class: EasyCaptcha::Captcha

Inherits:
Object
  • Object
show all
Defined in:
lib/easy_captcha/captcha.rb

Overview

captcha generation class

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(code) ⇒ Captcha

generate captcha by code



11
12
13
14
# File 'lib/easy_captcha/captcha.rb', line 11

def initialize code
  @code = code
  generate_captcha
end

Instance Attribute Details

#codeObject (readonly)

code for captcha generation



6
7
8
# File 'lib/easy_captcha/captcha.rb', line 6

def code
  @code
end

#imageObject (readonly)

blob of generated captcha image



8
9
10
# File 'lib/easy_captcha/captcha.rb', line 8

def image
  @image
end

Instance Method Details

#inspectObject

:nodoc:



16
17
18
# File 'lib/easy_captcha/captcha.rb', line 16

def inspect #:nodoc:
  "<EasyCaptcha::Captcha @code=#{code}>"
end