class

Athena::Serializer::Context

Inherits Reference < Object

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.

Instance methods

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

Adds strategy to self.

  • exclusion_strategy is set to strategy if there previously was no strategy.
  • exclusion_strategy is set to ASR::ExclusionStrategies::Disjunct if there was a exclusion_strategy already set.
  • strategy is added to the ASR::ExclusionStrategies::Disjunct if there are multiple strategies.
Source
direction

Returns which (de)serialization action self represents.

Source
exclusion_strategy

The ASR::ExclusionStrategies::ExclusionStrategyInterface being used.

Source
groups

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

Source
groups=(groups : Enumerable(String)) : self

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

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

Source
version

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

Source
version=(version : SemanticVersion | Nil)

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

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

Source

Nested types