module

Crest::ParamsDecoder

Module for decoding query-string into parameters.

Constants

ARRAY_REGEX = /[\[\]]+\Z/
SUBKEYS_REGEX = /[^\[\]]+(?:\]?\[\])?/

Instance methods

decode(query : String) : Hash(String, Type)

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"}
Source
match_context(context, subkey) : Type | Nil
Source

Nested types