module CrSerializer
Included Modules
- CrSerializer::Assertions
- JSON::Serializable
Defined in:
CrSerializer.crCrSerializer/base.cr
CrSerializer/validator.cr
Constructors
Class Method Summary
-
.version : String | Nil
Version used as the comparator for the
since
anduntil
serialization options. -
.version=(version : String | Nil)
Version used as the comparator for the
since
anduntil
serialization options.
Instance Method Summary
-
#serialize(groups : Array(String) = ["default"])
Serializes the object to JSON
-
#validate : Nil
Rerun all assertions on the current state of the object
-
#validator : CrSerializer::Validator
See
Validator
Instance methods inherited from module JSON::Serializable
to_json(json : JSON::Builder, groups : Array(String) = ["default"])
to_json
Constructor Detail
Class Method Detail
def self.version : String | Nil
#
Version used as the comparator for the since
and until
serialization options.
Should be set in your app's main file, such as;
CrSerializer.version = MyApp::VERSION
NOTE Must be a SemanticVersion
string
def self.version=(version : String | Nil)
#
Version used as the comparator for the since
and until
serialization options.
Should be set in your app's main file, such as;
CrSerializer.version = MyApp::VERSION
NOTE Must be a SemanticVersion
string
Instance Method Detail
def serialize(groups : Array(String) = ["default"])
#
Serializes the object to JSON
Optionally accepts an array of groups that should be serialized