Class: Castle::Headers::Filter
- Inherits:
-
Object
- Object
- Castle::Headers::Filter
- Defined in:
- lib/castle/headers/filter.rb
Overview
used for preparing valuable headers list
Instance Method Summary collapse
-
#call ⇒ Hash
Serialize HTTP headers.
-
#initialize(request) ⇒ Filter
constructor
A new instance of Filter.
Constructor Details
Instance Method Details
#call ⇒ Hash
Serialize HTTP headers
27 28 29 30 31 32 33 34 35 36 |
# File 'lib/castle/headers/filter.rb', line 27 def call @request_env .keys .each_with_object({}) do |header_name, acc| next unless header_name.match(VALUABLE_HEADERS) formatted_name = @header_format.call(header_name) acc[formatted_name] = @request_env[header_name].to_s end end |