Class: Amadeus::Response

Inherits:
Object
  • Object
show all
Defined in:
lib/amadeus/client/response.rb,
lib/amadeus/client/response/parser.rb

Overview

The response object returned for every API call.

Instance Attribute Summary collapse

Instance Attribute Details

#bodyString (readonly)

The raw body received from the API

Returns:

  • (String)


28
29
30
# File 'lib/amadeus/client/response.rb', line 28

def body
  @body
end

#dataHash (readonly)

The data extracted from the JSON data - if the body contained JSON

Returns:

  • (Hash)


24
25
26
# File 'lib/amadeus/client/response.rb', line 24

def data
  @data
end

#http_responseNet::HTTPResponse (readonly)

The actual HTTPResponse object returned from the Net::HTTP request

Returns:

  • (Net::HTTPResponse)


12
13
14
# File 'lib/amadeus/client/response.rb', line 12

def http_response
  @http_response
end

#parsedBoolean (readonly)

Wether the raw body has been parsed into JSON

Returns:

  • (Boolean)


32
33
34
# File 'lib/amadeus/client/response.rb', line 32

def parsed
  @parsed
end

#requestAmadeus::Request (readonly)

The actual Amadeus::Request object used to make this API call

Returns:



16
17
18
# File 'lib/amadeus/client/response.rb', line 16

def request
  @request
end

#resultHash (readonly)

The parsed JSON received from the API, if the result was JSON

Returns:

  • (Hash)


20
21
22
# File 'lib/amadeus/client/response.rb', line 20

def result
  @result
end

#status_codeNumber (readonly)

The HTTP status code for the response, if any

Returns:

  • (Number)


36
37
38
# File 'lib/amadeus/client/response.rb', line 36

def status_code
  @status_code
end