struct Athena::Routing::CompiledRoute::Token
inherits Struct
#
An immutable representation of a segment of a route used to reconstruct a valid URL from an ART::CompiledRoute
.
Constructors#
.new(type : Type, prefix : String, regex : Regex | Nil = nil, var_name : String | Nil = nil, important : Bool = false)
#
Methods#
#clone
#
Returns a copy of self
with all instance variables cloned.
#important? : Bool
#
Returns true
if this token should always be included within the generated URL, otherwise false
.
#prefix : String
#
Returns that static prefix related to this token.
#regex : Regex | ::Nil
#
Returns the pattern this ART::CompiledRoute::Token::Type::VARIABLE
token requires.
#type : Type
#
Returns the type this token represents.
#var_name : String | ::Nil
#
Returns the name of parameter this ART::CompiledRoute::Token::Type::VARIABLE
token represents.