abstract class CrSerializer::Context

Overview

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

Defined in:

context.cr

Instance Method Summary

Instance Method Detail

def add_exclusion_strategy(strategy : CrSerializer::ExclusionStrategies::ExclusionStrategy) : self #

Adds strategy to self.


[View source]

[View source]
def groups : Array(String)? #

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


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

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

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


[View source]
def version : SemanticVersion? #

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


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

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

Adds a CrSerializer::ExclusionStrategies::Version automatically if set.


[View source]