module Crest::ParamsDecoder
Overview
Module for decoding query-string into parameters.
Extended Modules
Defined in:
crest/params_decoder.crConstant Summary
-
ARRAY_REGEX =
/[\[\]]+\Z/
-
SUBKEYS_REGEX =
/[^\[\]]+(?:\]?\[\])?/
Instance Method Summary
-
#decode(query : String) : Hash(String, Type)
Converts the given URI query string into a hash.
- #match_context(context, subkey) : Type | Nil
Instance Method Detail
Converts the given URI query string into a hash.
Crest::ParamsDecoder.decode("a[]=one&a[]=two&a[]=three&b=true&c=C&d=1")
# => {"a" => ["one", "two", "three"], "b" => "true", "c" => "C", "d" => "1"}
Crest::ParamsDecoder.decode("a=one&a=two&a=three&b=true&c=C&d=1")
# => {"a" => ["one", "two", "three"], "b" => "true", "c" => "C", "d" => "1"}