lib/ocean/api.rb
#
# Returns the HTTP response body parsed from JSON. This is done lazily and only once.
#
Returns the HTTP response body parsed from JSON. This is done lazily and only once.
Returns the HTTP response body parsed from JSON . This is done lazily and only once .
def body
      @body ||= @response.response_body.blank? ? nil :
        begin
          JSON.parse(@response.response_body)
      rescue => error
        Rails.logger.error ({
          '>>> OCEAN RESPONSE JSON PARSE EXCEPTION' => "#{@response.response_body}",
          'request' => "#{@response.request.url}"
        }).to_json
        raise error
      end
    end
def body @body ||= @response . response_body . blank? ? nil : begin JSON . parse ( @response . response_body ) rescue => error Rails . logger . error ( { '>>> OCEAN RESPONSE JSON PARSE EXCEPTION' => "#{@response.response_body}" , 'request' => "#{@response.request.url}" } ) . to_json raise error end end
Returns the HTTP response body parsed from JSON.
Returns the HTTP response body parsed from JSON .