Module: ApiTransformer::Rack::CookieParams::Parser
- Included in:
- ApiTransformer::Rack::CookieParams
- Defined in:
- lib/api_transformer/rack/cookie_params.rb
Overview
Cookie string parser
Instance Method Summary collapse
Instance Method Details
#cookie_params(env) ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/api_transformer/rack/cookie_params.rb', line 7 def (env) = env["HTTP_COOKIE"] if = .split(/\s*;\s*/) .reduce({}) do |hash, pair| key, value = pair.split("=") hash.merge(key => value) end else {} end end |