Skip to content

module Athena::Framework::View::ViewHandlerInterface #

Processes an ATH::View into an ATH::Response of the proper format.

See the negotiation component for more information.

Direct including types

Athena::Framework::View::ConfigurableViewHandlerInterface

Methods#

abstract #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

abstract #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

abstract #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

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

Registers the provided handler to handle the provided format.

View source

abstract #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