Class: Amadeus::Request

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

Instance Attribute Details

#app_idString (readonly)

The custom app ID passed in for this request

Returns:

  • (String)


45
46
47
# File 'lib/amadeus/client/request.rb', line 45

def app_id
  @app_id
end

#app_versionString (readonly)

The custom app version used for this request

Returns:

  • (String)


48
49
50
# File 'lib/amadeus/client/request.rb', line 48

def app_version
  @app_version
end

#bearer_tokenString (readonly)

The bearer token (if any) that is used for authentication

Returns:

  • (String)


33
34
35
# File 'lib/amadeus/client/request.rb', line 33

def bearer_token
  @bearer_token
end

#client_versionString (readonly)

The library version used for this request

Returns:

  • (String)


39
40
41
# File 'lib/amadeus/client/request.rb', line 39

def client_version
  @client_version
end

#headersHash (readonly)

The headers used for the API call

Returns:

  • (Hash)


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

def headers
  @headers
end

#hostString (readonly)

The host used for this API call

Returns:

  • (String)


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

def host
  @host
end

#language_versionString (readonly)

The Ruby language version used for this request

Returns:

  • (String)


42
43
44
# File 'lib/amadeus/client/request.rb', line 42

def language_version
  @language_version
end

#paramsHash (readonly)

The GET/POST params for the API call

Returns:

  • (Hash)


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

def params
  @params
end

#pathString (readonly)

The path of the API to be called

Returns:

  • (String)


27
28
29
# File 'lib/amadeus/client/request.rb', line 27

def path
  @path
end

#portNumber (readonly)

The port for this API call. Standard set to 443.

Returns:

  • (Number)


15
16
17
# File 'lib/amadeus/client/request.rb', line 15

def port
  @port
end

#schemeString (readonly)

The scheme used to make the API call

Returns:

  • (String)


21
22
23
# File 'lib/amadeus/client/request.rb', line 21

def scheme
  @scheme
end

#sslBoolean (readonly)

Wether to use SSL for a call, defaults to true

Returns:

  • (Boolean)


18
19
20
# File 'lib/amadeus/client/request.rb', line 18

def ssl
  @ssl
end

#verbSymbol (readonly)

The verb used to make an API call (:GET or :POST)

Returns:

  • (Symbol)


30
31
32
# File 'lib/amadeus/client/request.rb', line 30

def verb
  @verb
end

Instance Method Details

#http_requestObject

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