Class: NewRelicHTTP::HTTPRequest
- Inherits:
-
Object
- Object
- NewRelicHTTP::HTTPRequest
- Defined in:
- lib/newrelic_httprb/wrappers.rb
Instance Attribute Summary collapse
-
#request ⇒ Object
readonly
Returns the value of attribute request.
-
#uri ⇒ Object
readonly
Returns the value of attribute uri.
Instance Method Summary collapse
- #[](key) ⇒ Object
- #[]=(key, value) ⇒ Object
- #host ⇒ Object
-
#initialize(request) ⇒ HTTPRequest
constructor
A new instance of HTTPRequest.
- #method ⇒ Object
- #type ⇒ Object
Constructor Details
#initialize(request) ⇒ HTTPRequest
Returns a new instance of HTTPRequest.
22 23 24 25 |
# File 'lib/newrelic_httprb/wrappers.rb', line 22 def initialize(request) @request = request @uri = request.uri end |
Instance Attribute Details
#request ⇒ Object (readonly)
Returns the value of attribute request.
20 21 22 |
# File 'lib/newrelic_httprb/wrappers.rb', line 20 def request @request end |
#uri ⇒ Object (readonly)
Returns the value of attribute uri.
20 21 22 |
# File 'lib/newrelic_httprb/wrappers.rb', line 20 def uri @uri end |
Instance Method Details
#[](key) ⇒ Object
43 44 45 |
# File 'lib/newrelic_httprb/wrappers.rb', line 43 def [](key) request.headers[key] end |
#[]=(key, value) ⇒ Object
47 48 49 |
# File 'lib/newrelic_httprb/wrappers.rb', line 47 def []=(key, value) request.headers[key] = value end |
#host ⇒ Object
31 32 33 34 35 36 37 |
# File 'lib/newrelic_httprb/wrappers.rb', line 31 def host if hostname = self['host'] hostname.split(':').first else request.host end end |
#method ⇒ Object
39 40 41 |
# File 'lib/newrelic_httprb/wrappers.rb', line 39 def method request.verb.upcase end |
#type ⇒ Object
27 28 29 |
# File 'lib/newrelic_httprb/wrappers.rb', line 27 def type "http.rb" end |