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



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

def initialize(code)
  @code = code
  generate_captcha
end

Instance Attribute Details

#codeObject (readonly)

code for captcha generation



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

def code
  @code
end

#imageObject (readonly)

blob of generated captcha image



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

def image
  @image
end

Instance Method Details

#inspectObject

:nodoc:



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

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