Skip to content

class Athena::Framework::View::Context
inherits Reference #

Represents (de)serialization options in a serializer agnostic way.

Methods#

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

Adds the provided strategy to the #exclusion_strategies array.

View source

#add_group(group : String) : self#

Adds the provided group to the #groups array.

View source

#add_groups(groups : Enumerable(String)) : self#

Adds the provided groups to the #groups array.

View source

#add_groups(*groups : String) : self#

Adds the provided groups to the #groups array.

View source

#emit_nil=(emit_nil : Bool | Nil)#

Determines if properties with nil values should be emitted.

View source

#emit_nil? : Bool | ::Nil#

Determines if properties with nil values should be emitted.

View source

#exclusion_strategies#

Returns any ASR::ExclusionStrategies::ExclusionStrategyInterface that should be used by the serializer.

View source

#groups : Set(String) | ::Nil#

Returns the groups that can be used to create different "views" of an object.

ASR::ExclusionStrategies::Groups is an example of this.

View source

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

Sets the #groups array to the provided groups.

View source

#version : SemanticVersion | ::Nil#

Represents the version of an object. Can be used to control what properties are serialized based on the version.

ASR::ExclusionStrategies::Version is an example of this.

View source

#version=(version : SemanticVersion | Nil)#

Represents the version of an object. Can be used to control what properties are serialized based on the version.

ASR::ExclusionStrategies::Version is an example of this.

View source

#version=(version : String) : self#

Sets the #version to the provided version.

View source