struct Amber::Router::ParamConstraints::Uuid

Overview

Matches a UUID in its 36-character hyphenated form, such as 550e8400-e29b-41d4-a716-446655440000, in either letter case.

Included Modules

Defined in:

amber/router/param_constraints/uuid.cr

Constant Summary

TEXT_LENGTH = 36

Constructors

Instance Method Summary

Instance methods inherited from module Amber::Router::ParamConstraint

matches?(segment : String) : Bool matches?, matches_span?(path : String, byte_offset : Int32, bytesize : Int32) : Bool matches_span?, to_s(io : IO) : Nil to_s

Constructor Detail

def self.new #

[View source]

Instance Method Detail

def initialize #

[View source]
def matches?(segment : String) : Bool #
Description copied from module Amber::Router::ParamConstraint

Returns true when segment satisfies this rule.


[View source]
def matches_span?(path : String, byte_offset : Int32, bytesize : Int32) : Bool #
Description copied from module Amber::Router::ParamConstraint

Returns true when the segment of path that starts at byte_offset and is bytesize bytes long satisfies this rule. The router calls this while it walks a path; the built-in rules override it to read the bytes in place instead of copying the segment.


[View source]
def to_s(io : IO) : Nil #
Description copied from module Amber::Router::ParamConstraint

Writes the short label that route listings and Route#to_json show for this rule.


[View source]