Skip to content

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

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

Note

These options only apply if the Serializer bundle is registered, otherwise data is serialized via #to_json.

Methods#

#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

#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