Skip to content

struct Athena::Routing::CompiledRoute
inherits Struct #

Represents an immutable snapshot of an ART::Route that exposes the Regex patterns and variables used to match/generate the route.

Constructors#

.new(static_prefix : String, regex : Regex, tokens : Array(ART::CompiledRoute::Token), path_variables : Set(String), host_regex : Regex | Nil = nil, host_tokens : Array(ART::CompiledRoute::Token) = Array(ART::CompiledRoute::Token).new, host_variables : Set(String) = Set(String).new, variables : Set(String) = Set(String).new)#

View source

Methods#

#clone#

Returns a copy of self with all instance variables cloned.

View source

#host_regex : Regex | ::Nil#

Returns the regex pattern used to match the hostname of this route.

View source

#host_tokens : Array(ART::CompiledRoute::Token)#

Returns the tokens that make up the hostname of this route.

View source

#host_variables : Set(String)#

Returns the names of the route parameters within the hostname pattern this route.

View source

#path_variables : Set(String)#

Returns the names of the route parameters within this route.

View source

#regex : Regex#

Returns the regex pattern used to match this route.

View source

#static_prefix : String#

Returns the static text prefix of this route.

View source

#tokens : Array(ART::CompiledRoute::Token)#

Returns the tokens that make up the path of this route.

View source

#variables : Set(String)#

Returns the compiled parameter names from the path and hostname patterns.

View source