Skip to content

class Athena::Routing::Generator::URLGenerator
inherits Reference #

Default implementation of ART::Generator::Interface.

Included modules

Athena::Routing::Generator::ConfigurableRequirementsInterface Athena::Routing::Generator::Interface

Constructors#

.new(context : ART::RequestContext, default_locale : String? = nil) #

View source

Methods#

#context #

Returns the request context.

View source

#context=(context : ART::RequestContext) #

Sets the request context.

View source

#generate(route : String, params : Hash(String, String?) = Hash(String, String | ::Nil).new, reference_type : ART::Generator::ReferenceType = :absolute_path) : String #

Generates a URL for the provided route, optionally with the provided params and reference_type.

View source

#generate(route : String, params : Hash(String, _) = Hash(String, String | ::Nil).new, reference_type : ART::Generator::ReferenceType = :absolute_path) : String #

:inherit:

View source

#generate(route : String, reference_type : ART::Generator::ReferenceType = :absolute_path, **params) : String #

:inherit:

View source

#strict_requirements=(strict_requirements : Bool?) #

Sets how invalid parameters should be treated:

  • true - Raise an exception for mismatched requirements.
  • false - Do not raise an exception, but return an empty string.
  • nil - Disables checks, returning a URL with possibly invalid parameters.
View source

#strict_requirements? #

Returns the current strict requirements mode.

View source