class Amber::Schema::Parser::QueryParser

Defined in:

amber/schema/parsers/query_parser.cr

Class Method Summary

Instance Method Summary

Instance methods inherited from class Amber::Schema::Parser::Base

can_parse?(value : JSON::Any) : Bool can_parse?, parse(value : JSON::Any) : JSON::Any parse

Class Method Detail

def self.parse_params_to_nested(params : HTTP::Params | Hash(String, String)) : Hash(String, JSON::Any) #

Convert flat params to nested structure


[View source]
def self.parse_query_string(query_string : String) : Hash(String, JSON::Any) #

Parse query string into nested hash structure


[View source]
def self.parse_value(value : String) : JSON::Any #

Try to parse value as JSON, number, or boolean


[View source]
def self.set_nested_value(hash : Hash(String, JSON::Any), key : String, value : String | JSON::Any) #

Handle nested parameter keys like user[profile][name]


[View source]
def self.to_query_string(data : Hash(String, JSON::Any), prefix : String | Nil = nil) : String #

Flatten nested hash to query string


[View source]

Instance Method Detail

def can_parse?(value : JSON::Any) : Bool #

[View source]
def parse(value : JSON::Any) : JSON::Any #

[View source]