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, groups : Array(String), expand : Array(String)) #

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

Serialize self to JSON.

Optionally, only serialize properties that are in 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 = " ", groups : Array(String) = ["default"], expand : Array(String) = [] of String) #

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

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

Serialize self to YAML.

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

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


[View source]