abstract class Object

Overview

Object is the base type of all Crystal objects.

Defined in:

CrSerializer/json/to_json.cr
CrSerializer/yaml/to_yaml.cr

Instance Method Summary

Instance Method Detail

def to_json(io : IO, serialization_groups : Array(String), expand : Array(String)) #

[View source]
def to_json(serialization_groups : Array(String) = ["default"], expand : Array(String) = [] of String) : String #

Serialize self to JSON.

Optionally, only serialize properties that are in serialization_groups. See the docs for more information.

Optionally, include expandable properties that are in expand. See the docs for more information.


[View source]
def to_pretty_json(indent : String = " ", serialization_groups : Array(String) = ["default"], expand : Array(String) = [] of String) #

[View source]
def to_pretty_json(io : IO, serialization_groups : Array(String), expand : Array(String), indent : String = " ") #

[View source]
def to_yaml(serialization_groups : Array(String) = ["default"], expand : Array(String) = [] of String) : String #

Serialize self to YAML.

Optionally, only serialize properties that are in serialization_groups. See the docs for more information.

Optionally, include expandable properties that are in expand. See the docs for more information.


[View source]