Class: AliyunIntelligentCaptcha::Result
- Inherits:
-
Object
- Object
- AliyunIntelligentCaptcha::Result
- Defined in:
- lib/aliyun_intelligent_captcha/result.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Instance Method Summary collapse
- #code ⇒ Object
-
#initialize(body:, status:) ⇒ Result
constructor
A new instance of Result.
- #message ⇒ Object
- #passed? ⇒ Boolean
- #request_id ⇒ Object
Constructor Details
#initialize(body:, status:) ⇒ Result
Returns a new instance of Result.
7 8 9 10 |
# File 'lib/aliyun_intelligent_captcha/result.rb', line 7 def initialize(body:, status:) @body = body @status = status.to_i end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
5 6 7 |
# File 'lib/aliyun_intelligent_captcha/result.rb', line 5 def body @body end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
5 6 7 |
# File 'lib/aliyun_intelligent_captcha/result.rb', line 5 def status @status end |
Instance Method Details
#code ⇒ Object
23 24 25 |
# File 'lib/aliyun_intelligent_captcha/result.rb', line 23 def code fetch_value("Code") end |
#message ⇒ Object
27 28 29 |
# File 'lib/aliyun_intelligent_captcha/result.rb', line 27 def fetch_value("Message") end |
#passed? ⇒ Boolean
12 13 14 15 16 17 |
# File 'lib/aliyun_intelligent_captcha/result.rb', line 12 def passed? truthy?(fetch_value("VerifyResult")) || truthy?(fetch_value("Passed")) || truthy?(fetch_value("Result")) || success_code? end |
#request_id ⇒ Object
19 20 21 |
# File 'lib/aliyun_intelligent_captcha/result.rb', line 19 def request_id fetch_value("RequestId") end |