Class: Datadog::Core::Remote::Transport::Negotiation::Transport

Inherits:
Object
  • Object
show all
Defined in:
lib/datadog/core/remote/transport/negotiation.rb

Overview

Negotiation transport

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(apis, default_api) ⇒ Transport

Returns a new instance of Transport.



42
43
44
45
46
# File 'lib/datadog/core/remote/transport/negotiation.rb', line 42

def initialize(apis, default_api)
  @apis = apis

  @client = HTTP::Client.new(current_api)
end

Instance Attribute Details

#apisObject (readonly)

Returns the value of attribute apis.



40
41
42
# File 'lib/datadog/core/remote/transport/negotiation.rb', line 40

def apis
  @apis
end

#clientObject (readonly)

Returns the value of attribute client.



40
41
42
# File 'lib/datadog/core/remote/transport/negotiation.rb', line 40

def client
  @client
end

#current_api_idObject (readonly)

Returns the value of attribute current_api_id.



40
41
42
# File 'lib/datadog/core/remote/transport/negotiation.rb', line 40

def current_api_id
  @current_api_id
end

#default_apiObject (readonly)

Returns the value of attribute default_api.



40
41
42
# File 'lib/datadog/core/remote/transport/negotiation.rb', line 40

def default_api
  @default_api
end

Instance Method Details

#current_apiObject



54
55
56
# File 'lib/datadog/core/remote/transport/negotiation.rb', line 54

def current_api
  @apis[HTTP::API::ROOT]
end

#send_infoObject



48
49
50
51
52
# File 'lib/datadog/core/remote/transport/negotiation.rb', line 48

def send_info
  request = Request.new

  @client.send_info_payload(request)
end