class Athena::Routing::Action::ViewContext

Overview

Stores runtime configuration data from the ARTA::View annotation about how to render the output of the related action.

This includes the action's HTTP::Status and any serialization related configuration options.

Defined in:

action.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(status : HTTP::Status | Nil = nil, emit_nil : Bool = false, serialization_groups : Array(String) | Nil = nil, validation_groups : Array(String) | Nil = nil) #

[View source]

Instance Method Detail

def emit_nil : Bool #

Returns true if nil values should be serialized.


[View source]
def emit_nil=(emit_nil : Bool) #

Returns true if nil values should be serialized.


[View source]
def has_custom_status? : Bool #

Returns true if the action related to self defined a custom status via the ARTA::View annotation, otherwise false.


[View source]
def serialization_groups : Array(String) | Nil #

Returns the groups that should be used for serialization as part of ASR::ExclusionStrategies::Groups.


[View source]
def serialization_groups=(serialization_groups : Array(String) | Nil) #

Returns the groups that should be used for serialization as part of ASR::ExclusionStrategies::Groups.


[View source]
def status : HTTP::Status #

Returns the HTTP::Status this action should return. Defaults to HTTP::Status::OK (200).


[View source]
def status=(status : HTTP::Status) #

Returns the HTTP::Status this action should return. Defaults to HTTP::Status::OK (200).


[View source]
def validation_groups : Array(String) | Nil #

Returns the groups that should be used to validate any objects related to this route.

See AVD::Constraint@validation-groups.


[View source]
def validation_groups=(validation_groups : Array(String) | Nil) #

Returns the groups that should be used to validate any objects related to this route.

See AVD::Constraint@validation-groups.


[View source]
def version : String | Nil #

Returns the serialization version to use for this route as part of ASR::ExclusionStrategies::Version.

Can be set as part of an ART::Events::Action event listener based on the resolved version of the request.


[View source]
def version=(version : String | Nil) #

Returns the serialization version to use for this route as part of ASR::ExclusionStrategies::Version.

Can be set as part of an ART::Events::Action event listener based on the resolved version of the request.


[View source]