Class: OneApm::Support::HTTPClients::ExconHTTPRequest
- Inherits:
-
Object
- Object
- OneApm::Support::HTTPClients::ExconHTTPRequest
- Defined in:
- lib/one_apm/support/http_clients/excon_wrappers.rb
Instance Method Summary collapse
- #[](key) ⇒ Object
- #[]=(key, value) ⇒ Object
- #host ⇒ Object
-
#initialize(datum) ⇒ ExconHTTPRequest
constructor
A new instance of ExconHTTPRequest.
- #method ⇒ Object
- #type ⇒ Object
- #uri ⇒ Object
Constructor Details
#initialize(datum) ⇒ ExconHTTPRequest
Returns a new instance of ExconHTTPRequest.
28 29 30 |
# File 'lib/one_apm/support/http_clients/excon_wrappers.rb', line 28 def initialize(datum) @datum = datum end |
Instance Method Details
#[](key) ⇒ Object
48 49 50 |
# File 'lib/one_apm/support/http_clients/excon_wrappers.rb', line 48 def [](key) @datum[:headers][key] end |
#[]=(key, value) ⇒ Object
52 53 54 55 |
# File 'lib/one_apm/support/http_clients/excon_wrappers.rb', line 52 def []=(key, value) @datum[:headers] ||= {} @datum[:headers][key] = value end |
#host ⇒ Object
36 37 38 39 40 41 42 |
# File 'lib/one_apm/support/http_clients/excon_wrappers.rb', line 36 def host if hostname = (self['host'] || self['Host']) hostname.split(':').first else @datum[:host] end end |
#method ⇒ Object
44 45 46 |
# File 'lib/one_apm/support/http_clients/excon_wrappers.rb', line 44 def method @datum[:method].to_s.upcase end |
#type ⇒ Object
32 33 34 |
# File 'lib/one_apm/support/http_clients/excon_wrappers.rb', line 32 def type "Excon" end |
#uri ⇒ Object
57 58 59 |
# File 'lib/one_apm/support/http_clients/excon_wrappers.rb', line 57 def uri URI.parse("#{@datum[:scheme]}://#{@datum[:host]}:#{@datum[:port]}#{@datum[:path]}") end |