Class: Hanami::Router::Params Private
- Inherits:
-
Object
- Object
- Hanami::Router::Params
- Defined in:
- lib/hanami/router/params.rb
Overview
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.
Params utilities
Class Method Summary collapse
-
.deep_symbolize(params) ⇒ Hash
private
Deep symbolize Hash params.
Class Method Details
.deep_symbolize(params) ⇒ Hash
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.
Deep symbolize Hash params
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/hanami/router/params.rb', line 18 def self.deep_symbolize(params) params.each_with_object({}) do |(key, value), output| output[key.to_sym] = case value when ::Hash deep_symbolize(value) when Array value.map do |item| item.is_a?(::Hash) ? deep_symbolize(item) : item end else value end end end |