lib/oktakit/error.rb
# Returns the appropriate Oktakit::Error subclass based
# on status and response message
#
# @param [Hash] response HTTP response
# @return [Oktakit::Error]
Returns the appropriate Oktakit::Error subclass based
on status and response message
Returns the appropriate Oktakit :: Error subclass based on status and response message
def parse_data
      body = @response[:body]
      return if body.empty?
      return body unless body.is_a?(String)
      headers = @response[:response_headers]
      content_type = headers && headers[:content_type] || ''
      if content_type =~ /json/
        Sawyer::Agent.serializer.decode(body)
      else
        body
      end
    end
def parse_data body = @response [ :body ] return if body . empty? return body unless body . is_a? ( String ) headers = @response [ :response_headers ] content_type = headers && headers [ :content_type ] || '' if content_type =~ / json / Sawyer :: Agent . serializer . decode ( body ) else body end end
Returns the appropriate Oktakit::Error subclass based
on status and response message
Returns the appropriate Oktakit :: Error subclass based on status and response message
None
Oktakit::Error
<not_specific>
response HTTP response
response HTTP response