Class: Qywx::Client::Result
- Inherits:
-
Object
- Object
- Qywx::Client::Result
- Defined in:
- lib/qywx/client/result.rb
Overview
HTTP Response result
Instance Attribute Summary collapse
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Instance Method Summary collapse
- #failed? ⇒ Boolean
-
#initialize(status, message: '') ⇒ Result
constructor
A new instance of Result.
- #success? ⇒ Boolean
Constructor Details
#initialize(status, message: '') ⇒ Result
Returns a new instance of Result.
11 12 13 14 |
# File 'lib/qywx/client/result.rb', line 11 def initialize(status, message: '') @status = status != false @message = .to_s end |
Instance Attribute Details
#message ⇒ Object (readonly)
Returns the value of attribute message.
7 8 9 |
# File 'lib/qywx/client/result.rb', line 7 def @message end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
7 8 9 |
# File 'lib/qywx/client/result.rb', line 7 def status @status end |
Instance Method Details
#failed? ⇒ Boolean
16 17 18 |
# File 'lib/qywx/client/result.rb', line 16 def failed? !success? end |
#success? ⇒ Boolean
20 21 22 |
# File 'lib/qywx/client/result.rb', line 20 def success? status end |