struct Athena::Routing::CompiledRoute::Token

Overview

An immutable representation of a segment of a route used to reconstruct a valid URL from an ART::CompiledRoute.

Defined in:

compiled_route.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(type : Type, prefix : String, regex : Regex | Nil = nil, var_name : String | Nil = nil, important : Bool = false) #

[View source]

Instance Method Detail

def clone #

Returns a copy of self with all instance variables cloned.


[View source]
def important? : Bool #

Returns true if this token should always be included within the generated URL, otherwise false.


[View source]
def prefix : String #

Returns that static prefix related to this token.


[View source]
def regex : Regex | Nil #

Returns the pattern this ART::CompiledRoute::Token::Type::VARIABLE token requires.


[View source]
def type : Type #

Returns the type this token represents.


[View source]
def var_name : String | Nil #

Returns the name of parameter this ART::CompiledRoute::Token::Type::VARIABLE token represents.


[View source]