Class: Turbot::API::FailureResponse
- Inherits:
-
Object
- Object
- Turbot::API::FailureResponse
- Defined in:
- lib/turbot_api/api.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#message ⇒ Object
readonly
Returns the value of attribute message.
Instance Method Summary collapse
-
#initialize(response) ⇒ FailureResponse
constructor
A new instance of FailureResponse.
Constructor Details
#initialize(response) ⇒ FailureResponse
Returns a new instance of FailureResponse.
142 143 144 145 146 |
# File 'lib/turbot_api/api.rb', line 142 def initialize(response) data = JSON.parse(response.body, :symbolize_names => true) @error_code = data[:error_code] @message = data[:message] end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
140 141 142 |
# File 'lib/turbot_api/api.rb', line 140 def data @data end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
140 141 142 |
# File 'lib/turbot_api/api.rb', line 140 def @message end |