Skip to content

class Athena::Routing::Action::ViewContext
inherits Reference #

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.

Class methods#

.new(status : HTTP::Status? = nil, emit_nil : Bool = false, serialization_groups : Array(String)? = nil, validation_groups : Array(String)? = nil) #

View source

Methods#

#emit_nil : Bool #

Returns true if nil values should be serialized.

View source

#emit_nil=(emit_nil : Bool) #

Returns true if nil values should be serialized.

View source

#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

#serialization_groups : Array(String)? #

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

View source

#serialization_groups=(serialization_groups : Array(String)?) #

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

View source

#status : HTTP::Status #

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

View source

#status=(status : HTTP::Status) #

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

View source

#validation_groups : Array(String)? #

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

See AVD::Constraint@validation-groups.

View source

#validation_groups=(validation_groups : Array(String)?) #

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

See AVD::Constraint@validation-groups.

View source

#version : String? #

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

#version=(version : String?) #

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