abstract class Object

Overview

Object is the base type of all Crystal objects.

Direct Known Subclasses

Defined in:

nason/any.cr
nason/null.cr
nason/to_json.cr

Class Method Summary

Instance Method Summary

Class Method Detail

def self.from_nason(string_or_io, root : String) #

Deserializes the given NASON in string_or_io into an instance of self, assuming the NASON consists of an NASON object with key root, and whose value is the value to deserialize.

Int32.from_nason(%({"main": 1}), root: "main") # => 1

[View source]
def self.from_nason(string_or_io) #

Deserializes the given NASON in string_or_io into an instance of self. This simply creates a parser = NASON::PullParser and invokes new(parser): classes that want to provide NASON deserialization must provide an def initialize(parser : NASON::PullParser) method.

Int32.from_nason("1")                # => 1
Array(Int32).from_nason("[1, 2, 3]") # => [1, 2, 3]

[View source]

Instance Method Detail

def ===(other : NASON::Any) #

[View source]
def nil_or_null? #

[View source]
def not_null! #

[View source]
def null? #

[View source]
def to_nason(io : IO) : Nil #

[View source]
def to_nason : String #

[View source]
def to_pretty_json(indent : String = " ") : String #

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

[View source]