module Amber::Schema::Parser::FormKey

Overview

The shapes of form keys and form values, read byte by byte in one pass.

Defined in:

amber/schema/parsers/form_key.cr

Class Method Summary

Class Method Detail

def self.decimal?(text : String) : Bool #

True for -1, 1.5, .5 and 2e10: an optional minus sign, an optional whole part, an optional dot, required digits, and an optional exponent.


[View source]
def self.digits?(text : String) : Bool #

True when text is one or more ASCII digits.


[View source]
def self.indexed_name_and_index(key : String) : Tuple(String, String) | Nil #

Splits tags[12] into {"tags", "12"}. Returns nil for any other shape.


[View source]
def self.integer?(text : String) : Bool #

True for an optional minus sign followed by digits.


[View source]
def self.segments(key : String) : Array(String) #

Splits user[tags][0] into ["user", "tags", "0"].


[View source]