Class: Kamcaptcha::Generator::RandomWordGenerator
- Inherits:
-
WordGenerator
- Object
- WordGenerator
- Kamcaptcha::Generator::RandomWordGenerator
- Defined in:
- lib/kamcaptcha/generator.rb
Constant Summary collapse
- CHARS =
"23456789ABCDEFGHJKLMNPQRSTUVXYZ".split("")
Instance Attribute Summary
Attributes inherited from WordGenerator
Instance Method Summary collapse
Methods inherited from WordGenerator
Constructor Details
This class inherits a constructor from Kamcaptcha::Generator::WordGenerator
Instance Method Details
#generate ⇒ Object
28 29 30 31 32 33 |
# File 'lib/kamcaptcha/generator.rb', line 28 def generate length = min length += Kernel.rand(max - min) unless max == min (1..length).map { CHARS[rand(CHARS.size)] }.join(" ") end |