struct Athena::Routing::Listeners::View

Overview

The view listener attempts to resolve a non ART::Response into an ART::Response. Currently this is achieved by JSON serializing the controller action's resulting value; either via Object#to_json or ASR::Serializer, depending on what type the resulting value is.

In the future this listener will handle executing the correct view handler based on the registered formats and the format that the initial HTTP::Request requires.

TODO Implement a format negotiation algorithm.

Included Modules

Defined in:

listeners/view_listener.cr

Constructors

Class Method Summary

Instance Method Summary

Constructor Detail

def self.new(serializer : ASR::SerializerInterface) #

[View source]

Class Method Detail

def self.subscribed_events : AED::SubscribedEvents #

[View source]

Instance Method Detail

def call(event : ART::Events::View, dispatcher : AED::EventDispatcherInterface) : Nil #

[View source]