Skip to content

class Athena::Routing::View::ViewHandler
inherits Reference #

Default implementation of ART::View::ConfigurableViewHandlerInterface.

Included modules

Athena::Routing::View::ConfigurableViewHandlerInterface

Class methods#

Methods#

#create_redirect_response(view : ART::ViewBase, location : String, format : String) : ART::Response #

Creates an ART::Response based on the provided view that'll redirect to the provided location.

location may either be a URL or the name of a route.

View source

#create_response(view : ART::ViewBase, request : ART::Request, format : String) : ART::Response #

Creates an ART::Response based on the provided view and request.

View source

#emit_nil=(emit_nil : Bool) : Nil #

Determines if properties with nil values should be emitted.

View source

#handle(view : ART::ViewBase, request : ART::Request? = nil) : ART::Response #

Handles the conversion of the provided view into an ART::Response.

If no request is provided, it is fetched from ART::RequestStore.

View source

#register_handler(format : String, handler : ART::View::ViewHandlerInterface::HandlerType) : Nil #

Registers the provided handler to handle the provided format.

View source

#serialization_groups=(groups : Enumerable(String)) : Nil #

Sets the groups that should be used as part of ASR::ExclusionStrategies::Groups.

View source

#serialization_version=(version : String) : Nil #

:inherit:

View source

#serialization_version=(serialization_version : SemanticVersion) : Nil #

Sets the version that should be used as part of ASR::ExclusionStrategies::Version.

View source

#supports?(format : String) : Bool #

Determines if self can handle the provided format.

First checks if a custom format handler supports the provided format, otherwise falls back on the ASR::SerializerInterface.

View source