Skip to content

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)#

View source

Methods#

#clone#

Returns a copy of self with all instance variables cloned.

View source

#important? : Bool#

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

View source

#prefix : String#

Returns that static prefix related to this token.

View source

#regex : Regex | ::Nil#

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

View source

#type : Type#

Returns the type this token represents.

View source

#var_name : String | ::Nil#

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

View source