class Marten::Routing::Reverser

Overview

Represents a route reverser.

A route reverser allows to perform URL / route lookups for a given route. Such routes can optionally expect parameters and such parameters are handled accordingly when the #reverse method is called. The main Marten::Routing::Map#reverse method makes use of reverser objects internally in order to perform routes lookups.

Defined in:

marten/routing/reverser.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(name : String, path_for_interpolation : String, parameters : Hash(String, Marten::Routing::Parameter::Base) = {} of String => Parameter::Base) #

[View source]

Instance Method Detail

def name : String #

[View source]
def parameters : Hash(String, Marten::Routing::Parameter::Base) #

[View source]
def path_for_interpolation : String #

[View source]
def reverse(params : Nil | Hash(String | Symbol, Parameter::Types)) : Nil | String #

[View source]