class MxHero::API::Response
The class that contains the response information
The code represent the HTTP code of the response.
The msg represent a hash with the response information. Example:
{ status: 500, code: 500, developerMessage: "rules.already.exists.for.component", moreInfoUrl: "mailto:support@mxhero.com" }
Public Instance Methods
error()
click to toggle source
@return [String] the error message
# File lib/response.rb, line 24 def error content[:developerMessage] if content.is_a? Hash end
success?()
click to toggle source
Response
is successful? Based in HTTP status code
# File lib/response.rb, line 19 def success? code.to_i == 200 || code.to_i == 201 end