abstract class Athena::Serializer::Context

Overview

Stores runtime data about the current action.

Such as what serialization groups/version to use when serializing.

!!!warning Cannot be used for more than one action.

Direct Known Subclasses

Defined in:

context.cr

Instance Method Summary

Instance Method Detail

def add_exclusion_strategy(strategy : ASR::ExclusionStrategies::ExclusionStrategyInterface) : self #

Adds strategy to self.


[View source]
abstract def direction : ASR::Context::Direction #

Returns which (de)serialization action self represents.


[View source]

[View source]
def groups : Set(String) | Nil #

Returns the serialization groups, if any, currently set on self.


[View source]
def groups=(groups : Enumerable(String)) : self #

Sets the group(s) to compare against properties' ASRA::Groups annotations.

Adds a ASR::ExclusionStrategies::Groups automatically if set.


[View source]
def version : SemanticVersion | Nil #

Returns the version, if any, currently set on self.


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

Returns the version, if any, currently set on self.


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

Sets the version to compare against properties' ASRA::Since and ASRA::Until annotations.

Adds an ASR::ExclusionStrategies::Version automatically if set.


[View source]