Class: NewRelic::Agent::HTTPClients::TyphoeusHTTPRequest
- Inherits:
-
Object
- Object
- NewRelic::Agent::HTTPClients::TyphoeusHTTPRequest
- Defined in:
- lib/new_relic/agent/http_clients/typhoeus_wrappers.rb
Instance Method Summary collapse
- #[](key) ⇒ Object
- #[]=(key, value) ⇒ Object
- #host ⇒ Object
-
#initialize(request) ⇒ TyphoeusHTTPRequest
constructor
A new instance of TyphoeusHTTPRequest.
- #method ⇒ Object
- #type ⇒ Object
- #uri ⇒ Object
Constructor Details
#initialize(request) ⇒ TyphoeusHTTPRequest
Returns a new instance of TyphoeusHTTPRequest.
39 40 41 42 |
# File 'lib/new_relic/agent/http_clients/typhoeus_wrappers.rb', line 39 def initialize(request) @request = request @uri = URI.parse(request.url) end |
Instance Method Details
#[](key) ⇒ Object
56 57 58 59 |
# File 'lib/new_relic/agent/http_clients/typhoeus_wrappers.rb', line 56 def [](key) return nil unless @request. && @request.[:headers] @request.[:headers][key] end |
#[]=(key, value) ⇒ Object
61 62 63 64 |
# File 'lib/new_relic/agent/http_clients/typhoeus_wrappers.rb', line 61 def []=(key, value) @request.[:headers] ||= {} @request.[:headers][key] = value end |
#host ⇒ Object
48 49 50 |
# File 'lib/new_relic/agent/http_clients/typhoeus_wrappers.rb', line 48 def host @uri.host end |
#method ⇒ Object
52 53 54 |
# File 'lib/new_relic/agent/http_clients/typhoeus_wrappers.rb', line 52 def method (@request.[:method] || 'GET').to_s.upcase end |
#type ⇒ Object
44 45 46 |
# File 'lib/new_relic/agent/http_clients/typhoeus_wrappers.rb', line 44 def type "Typhoeus" end |
#uri ⇒ Object
66 67 68 |
# File 'lib/new_relic/agent/http_clients/typhoeus_wrappers.rb', line 66 def uri @uri end |