lib/roda/plugins/indifferent_params.rb
# Recursively process the request params and convert
# hashes to support indifferent access, leaving
# other values alone.
Recursively process the request params and convert
hashes to support indifferent access, leaving
other values alone.
Recursively process the request params and convert hashes to support indifferent access leaving other values alone .
def indifferent_params(params)
            case params 
            when Hash
              hash = Hash.new(&INDIFFERENT_PROC)
              params.each{|k, v| hash[k] = indifferent_params(v)}
              hash
            when Array
              params.map{|x| indifferent_params(x)}
            else
              params
            end
          end
def indifferent_params ( params ) case params when Hash hash = Hash . new ( & INDIFFERENT_PROC ) params . each { | k , v | hash [ k ] = indifferent_params ( v ) } hash when Array params . map { | x | indifferent_params ( x ) } else params end end
Recursively process the request params and convert
hashes to support indifferent access, leaving
other values alone.
Recursively process the request params and convert hashes to support indifferent access leaving other values alone .
params