Class: StackifyRubyAPM::Context::Request::Headers Private
- Inherits:
-
Object
- Object
- StackifyRubyAPM::Context::Request::Headers
- Includes:
- NaivelyHashable
- Defined in:
- lib/stackify_apm/context/request/headers.rb
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Instance Attribute Summary collapse
- #values ⇒ Object readonly private
Instance Method Summary collapse
- #build_headers(req) ⇒ Object private
-
#initialize(req) ⇒ Headers
constructor
private
A new instance of Headers.
Methods included from NaivelyHashable
Constructor Details
#initialize(req) ⇒ Headers
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Headers.
12 13 14 |
# File 'lib/stackify_apm/context/request/headers.rb', line 12 def initialize(req) @values = build_headers req end |
Instance Attribute Details
#values ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
16 17 18 |
# File 'lib/stackify_apm/context/request/headers.rb', line 16 def values @values end |
Instance Method Details
#build_headers(req) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
18 19 20 21 22 23 24 25 26 |
# File 'lib/stackify_apm/context/request/headers.rb', line 18 def build_headers req env = req.env headers = Hash[*env.select {|k,v| k.start_with? 'HTTP_'} .collect {|k,v| [k.sub(/^HTTP_/, ''), v]} .collect {|k,v| [k.split('_').collect(&:capitalize).join('-'), v]} .sort .flatten] return headers end |