Skip to content

module Athena::Routing::View::ViewHandlerInterface #

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

See the negotiation component for more information.

Direct including types

Athena::Routing::View::ConfigurableViewHandlerInterface

Methods#

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

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

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

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