Skip to content

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

Default implementation of ATH::View::ConfigurableViewHandlerInterface.

Included modules

Athena::Framework::View::ConfigurableViewHandlerInterface

Constructors#

Methods#

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

Creates an ATH::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 : ATH::ViewBase, request : ATH::Request, format : String) : ATH::Response #

Creates an ATH::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 : ATH::ViewBase, request : ATH::Request? = nil) : ATH::Response #

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

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

View source

#register_handler(format : String, handler : ATH::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