module JSONAPI::Parser::HeadersParser
Header parsing logic
Public Class Methods
parse(env)
click to toggle source
@param env [Hash] The rack envirornment hash @return [JSONAPI::HeaderCollection] The collection of parsed header objects
# File lib/easy/jsonapi/parser/headers_parser.rb, line 19 def self.parse(env) h_collection = JSONAPI::HeaderCollection.new env.each_key do |k| if k.start_with?('HTTP_') && (k != 'HTTP_VERSION') h_collection << JSONAPI::HeaderCollection::Header.new(k[5..-1], env[k]) elsif k == 'CONTENT_TYPE' h_collection << JSONAPI::HeaderCollection::Header.new(k, env[k]) end end h_collection end