class Marten::Routing::Parameter::Slug

Defined in:

marten/routing/parameter/slug.cr

Instance Method Summary

Instance methods inherited from class Marten::Routing::Parameter::Base

dumps(value) : Nil | ::String dumps, loads(value : ::String) loads, regex : Regex regex

Instance Method Detail

def dumps(value) : Nil | ::String #
Description copied from class Marten::Routing::Parameter::Base

Returns the string representation of the specified route parameter object.

Note that this method can either return a string or nil: nil means that the passed value cannot be serialized properly, which will make any URL reverse resolution fail with a Marten::Routing::Errors::NoReverseMatch error.


[View source]
def loads(value : ::String) : ::String #
Description copied from class Marten::Routing::Parameter::Base

Parses a raw string parmater and returns the corresponding Crystal object.

The returned object is the one that will be forwarded to the handler in the route parameters hash.


[View source]
def regex : Regex #
Description copied from class Marten::Routing::Parameter::Base

Returns the Regex object to use to match parameters when routes are processed.


[View source]