Class: AntiCaptcha::TaskResult

Inherits:
Model
  • Object
show all
Defined in:
lib/anti_captcha/models/task_result.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_result, task_id) ⇒ TaskResult

Returns a new instance of TaskResult.



6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/anti_captcha/models/task_result.rb', line 6

def initialize(api_result, task_id)
  @task_id = task_id

  @api_result        = api_result
  @error_id          = api_result['errorId']
  @error_code        = api_result['errorCode']
  @error_description = api_result['errorDescription']
  @status            = api_result['status']
  @cost              = api_result['cost']
  @ip                = api_result['ip']
  @create_time       = api_result['createTime']
  @end_time          = api_result['endTime']
  @solve_count       = api_result['solveCount']
end

Instance Attribute Details

#api_resultObject

Returns the value of attribute api_result.



3
4
5
# File 'lib/anti_captcha/models/task_result.rb', line 3

def api_result
  @api_result
end

#costObject

Returns the value of attribute cost.



3
4
5
# File 'lib/anti_captcha/models/task_result.rb', line 3

def cost
  @cost
end

#create_timeObject

Returns the value of attribute create_time.



3
4
5
# File 'lib/anti_captcha/models/task_result.rb', line 3

def create_time
  @create_time
end

#end_timeObject

Returns the value of attribute end_time.



3
4
5
# File 'lib/anti_captcha/models/task_result.rb', line 3

def end_time
  @end_time
end

#error_codeObject

Returns the value of attribute error_code.



3
4
5
# File 'lib/anti_captcha/models/task_result.rb', line 3

def error_code
  @error_code
end

#error_descriptionObject

Returns the value of attribute error_description.



3
4
5
# File 'lib/anti_captcha/models/task_result.rb', line 3

def error_description
  @error_description
end

#error_idObject

Returns the value of attribute error_id.



3
4
5
# File 'lib/anti_captcha/models/task_result.rb', line 3

def error_id
  @error_id
end

#ipObject

Returns the value of attribute ip.



3
4
5
# File 'lib/anti_captcha/models/task_result.rb', line 3

def ip
  @ip
end

#solve_countObject

Returns the value of attribute solve_count.



3
4
5
# File 'lib/anti_captcha/models/task_result.rb', line 3

def solve_count
  @solve_count
end

#statusObject

Returns the value of attribute status.



3
4
5
# File 'lib/anti_captcha/models/task_result.rb', line 3

def status
  @status
end

#task_idObject

Returns the value of attribute task_id.



3
4
5
# File 'lib/anti_captcha/models/task_result.rb', line 3

def task_id
  @task_id
end