Class: Datadog::Core::Transport::HTTP::API::Endpoint

Inherits:
Object
  • Object
show all
Defined in:
lib/datadog/core/transport/http/api/endpoint.rb

Overview

Endpoint

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(verb, path, encoder: nil) ⇒ Endpoint

Returns a new instance of Endpoint.



20
21
22
23
24
# File 'lib/datadog/core/transport/http/api/endpoint.rb', line 20

def initialize(verb, path, encoder: nil)
  @verb = verb
  @path = path
  @encoder = encoder
end

Instance Attribute Details

#encoderObject (readonly)

TODO Currently only Traces transport specifies an encoder. Other transports perform encoding “inline” / ad-hoc. They should probably use this encoder field instead.



18
19
20
# File 'lib/datadog/core/transport/http/api/endpoint.rb', line 18

def encoder
  @encoder
end

#pathObject (readonly)

Returns the value of attribute path.



13
14
15
# File 'lib/datadog/core/transport/http/api/endpoint.rb', line 13

def path
  @path
end

#verbObject (readonly)

Returns the value of attribute verb.



12
13
14
# File 'lib/datadog/core/transport/http/api/endpoint.rb', line 12

def verb
  @verb
end

Instance Method Details

#call(env) {|env| ... } ⇒ Object

Yields:

  • (env)


26
27
28
29
30
# File 'lib/datadog/core/transport/http/api/endpoint.rb', line 26

def call(env)
  env.verb = verb
  env.path = path
  yield(env)
end