Skip to content

Context

abstract class Athena::Serializer::Context
inherits Reference

Stores runtime data about the current action.

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

NOTE: Cannot be used for more than one action.

Direct known subclasses

Athena::Serializer::DeserializationContext Athena::Serializer::SerializationContext

Methods

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

Adds strategy to self.

abstract #direction : ASR::Context::Direction

Returns which (de)serialization action self represents.

#groups : Array(String)?

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

#groups=(groups : Array(String)) : self

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

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

#version : SemanticVersion?

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

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