Class: Turbot::API::FailureResponse

Inherits:
Object
  • Object
show all
Defined in:
lib/turbot_api/api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(response) ⇒ FailureResponse

Returns a new instance of FailureResponse.



141
142
143
144
145
# File 'lib/turbot_api/api.rb', line 141

def initialize(response)
  data = JSON.parse(response.body, :symbolize_names => true)
  @error_code = data[:error_code]
  @message = data[:message]
end

Instance Attribute Details

#dataObject (readonly)

Returns the value of attribute data.



139
140
141
# File 'lib/turbot_api/api.rb', line 139

def data
  @data
end

#messageObject (readonly)

Returns the value of attribute message.



139
140
141
# File 'lib/turbot_api/api.rb', line 139

def message
  @message
end