Class: Amadeus::Request
- Inherits:
-
Object
- Object
- Amadeus::Request
- Defined in:
- lib/amadeus/client/request.rb,
lib/amadeus/client/request/hash.rb
Overview
A Request object containing all the compiled information about this request.
Instance Attribute Summary collapse
-
#app_id ⇒ String
readonly
The custom app ID passed in for this request.
-
#app_version ⇒ String
readonly
The custom app version used for this request.
-
#bearer_token ⇒ String
readonly
The bearer token (if any) that is used for authentication.
-
#client_version ⇒ String
readonly
The library version used for this request.
-
#headers ⇒ Hash
readonly
The headers used for the API call.
-
#host ⇒ String
readonly
The host used for this API call.
-
#language_version ⇒ String
readonly
The Ruby language version used for this request.
-
#params ⇒ Hash
readonly
The GET/POST params for the API call.
-
#path ⇒ String
readonly
The path of the API to be called.
-
#port ⇒ Number
readonly
The port for this API call.
-
#scheme ⇒ String
readonly
The scheme used to make the API call.
-
#ssl ⇒ Boolean
readonly
Wether to use SSL for a call, defaults to true.
-
#verb ⇒ Symbol
readonly
The verb used to make an API call (:GET or :POST).
Instance Method Summary collapse
-
#http_request ⇒ Object
Builds the request object.
Instance Attribute Details
#app_id ⇒ String (readonly)
The custom app ID passed in for this request
45 46 47 |
# File 'lib/amadeus/client/request.rb', line 45 def app_id @app_id end |
#app_version ⇒ String (readonly)
The custom app version used for this request
48 49 50 |
# File 'lib/amadeus/client/request.rb', line 48 def app_version @app_version end |
#bearer_token ⇒ String (readonly)
The bearer token (if any) that is used for authentication
33 34 35 |
# File 'lib/amadeus/client/request.rb', line 33 def bearer_token @bearer_token end |
#client_version ⇒ String (readonly)
The library version used for this request
39 40 41 |
# File 'lib/amadeus/client/request.rb', line 39 def client_version @client_version end |
#headers ⇒ Hash (readonly)
The headers used for the API call
36 37 38 |
# File 'lib/amadeus/client/request.rb', line 36 def headers @headers end |
#host ⇒ String (readonly)
The host used for this API call
12 13 14 |
# File 'lib/amadeus/client/request.rb', line 12 def host @host end |
#language_version ⇒ String (readonly)
The Ruby language version used for this request
42 43 44 |
# File 'lib/amadeus/client/request.rb', line 42 def language_version @language_version end |
#params ⇒ Hash (readonly)
The GET/POST params for the API call
24 25 26 |
# File 'lib/amadeus/client/request.rb', line 24 def params @params end |
#path ⇒ String (readonly)
The path of the API to be called
27 28 29 |
# File 'lib/amadeus/client/request.rb', line 27 def path @path end |
#port ⇒ Number (readonly)
The port for this API call. Standard set to 443.
15 16 17 |
# File 'lib/amadeus/client/request.rb', line 15 def port @port end |
#scheme ⇒ String (readonly)
The scheme used to make the API call
21 22 23 |
# File 'lib/amadeus/client/request.rb', line 21 def scheme @scheme end |
#ssl ⇒ Boolean (readonly)
Wether to use SSL for a call, defaults to true
18 19 20 |
# File 'lib/amadeus/client/request.rb', line 18 def ssl @ssl end |
#verb ⇒ Symbol (readonly)
The verb used to make an API call (:GET or :POST)
30 31 32 |
# File 'lib/amadeus/client/request.rb', line 30 def verb @verb end |
Instance Method Details
#http_request ⇒ Object
Builds the request object
64 65 66 67 68 69 70 71 72 |
# File 'lib/amadeus/client/request.rb', line 64 def http_request @http_request ||= begin request = request_for_verb add_post_data(request) add_bearer_token(request) add_headers(request) request end end |