Class: RailsObservatory::HeadersSerializer
- Inherits:
-
Object
- Object
- RailsObservatory::HeadersSerializer
- Defined in:
- lib/rails_observatory/serializers/headers_serializer.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.klass ⇒ Object
8 9 10 |
# File 'lib/rails_observatory/serializers/headers_serializer.rb', line 8 def self.klass ActionDispatch::Http::Headers end |
Instance Method Details
#serialize(headers) ⇒ Object
3 4 5 6 |
# File 'lib/rails_observatory/serializers/headers_serializer.rb', line 3 def serialize(headers) http_headers = Hash[*headers.select { |k, v| k.start_with?("HTTP_") }.flatten] http_headers.transform_keys! { |k| k.sub("HTTP_", "").downcase.capitalize.dasherize } end |