class Athena::Routing::Generator::URLGenerator
- Athena::Routing::Generator::URLGenerator
- Reference
- Object
Overview
Default implementation of ART::Generator::Interface
.
Included Modules
Defined in:
generator/url_generator.crConstructors
Instance Method Summary
-
#context : ART::RequestContext
Returns the request context.
-
#context=(context : ART::RequestContext)
Sets the request context.
-
#generate(route : String, params : Hash(String, String | Nil) = 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.
-
#generate(route : String, params : Hash(String, _) = Hash(String, String | ::Nil).new, reference_type : ART::Generator::ReferenceType = :absolute_path) : String
:inherit:
-
#generate(route : String, reference_type : ART::Generator::ReferenceType = :absolute_path, **params) : String
Generates a URL for the provided route, optionally with the provided params and reference_type.
-
#strict_requirements=(enabled : Bool | Nil)
Sets how invalid parameters should be treated:
-
#strict_requirements? : Bool | Nil
Returns the current strict requirements mode.
Instance methods inherited from module Athena::Routing::Generator::ConfigurableRequirementsInterface
strict_requirements=(enabled : Bool | Nil)
strict_requirements=,
strict_requirements? : Bool | Nil
strict_requirements?
Instance methods inherited from module Athena::Routing::Generator::Interface
generate(route : String, params : Hash(String, String | Nil) = Hash(String, String | ::Nil).new, reference_type : ART::Generator::ReferenceType = :absolute_path) : Stringgenerate(route : String, reference_type : ART::Generator::ReferenceType = :absolute_path, **params) : String generate
Instance methods inherited from module Athena::Routing::RequestContextAwareInterface
context : ART::RequestContext
context,
context=(context : ART::RequestContext)
context=
Constructor Detail
Instance Method Detail
def generate(route : String, params : Hash(String, String | Nil) = 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.
def generate(route : String, params : Hash(String, _) = Hash(String, String | ::Nil).new, reference_type : ART::Generator::ReferenceType = :absolute_path) : String
#
:inherit:
def generate(route : String, reference_type : ART::Generator::ReferenceType = :absolute_path, **params) : String
#
Generates a URL for the provided route, optionally with the provided params and reference_type.
def strict_requirements=(enabled : Bool | Nil)
#
Description copied from module Athena::Routing::Generator::ConfigurableRequirementsInterface
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.