Class: VisualCaptcha::Challenge

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(answer, options = nil) ⇒ Challenge

Returns a new instance of Challenge.



29
30
31
32
33
34
# File 'lib/visualcaptcha.rb', line 29

def initialize(answer, options=nil)
  @answer = answer
  @options = options
  @options << answer
  @options.shuffle!
end

Instance Attribute Details

#answerObject

Returns the value of attribute answer.



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

def answer
  @answer
end

#optionsObject

Returns the value of attribute options.



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

def options
  @options
end