Class: DeathByCaptcha::Captcha

Inherits:
Model
  • Object
show all
Defined in:
lib/deathbycaptcha/models/captcha.rb

Overview

Model of a Captcha returned by DeathByCaptcha API.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Model

#initialize

Constructor Details

This class inherits a constructor from DeathByCaptcha::Model

Instance Attribute Details

#captchaObject

Returns the value of attribute captcha.



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

def captcha
  @captcha
end

#is_correctObject

Returns the value of attribute is_correct.



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

def is_correct
  @is_correct
end

#textObject Also known as: token

Returns the value of attribute text.



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

def text
  @text
end

Instance Method Details

#idObject



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

def id
  @captcha
end

#parsed_textObject Also known as: coordinates, indexes



20
21
22
23
24
# File 'lib/deathbycaptcha/models/captcha.rb', line 20

def parsed_text
  JSON.parse(text)
rescue
  []
end