class JSON::OnSteroids

Overview

Handle JSON into a mutable structure, and much more.

Included Modules

Defined in:

json_on_steroids.cr:6
json_on_steroids.cr:13

Constant Summary

UTC_ISO_FORMAT = "%FT%T.%LZ"
VERSION = 0.1

Constructors

Class Method Summary

Instance Method Summary

Instance methods inherited from module JSON::OnSteroids::MergeOperations

%(t : Enumerable) %, -(t : Enumerable) -, merge(x : NamedTuple)
merge(x : JSON::OnSteroids | JSON::Any)
merge
, merge!(x : NamedTuple)
merge!(x : JSON::OnSteroids | JSON::Any)
merge!

Instance methods inherited from module JSON::OnSteroids::Dirty

clean! clean!, dirty! dirty!, dirty? : Bool dirty?, dirty_only dirty_only

Instance methods inherited from module JSON::OnSteroids::InPlace

delete(key : Int | String | Nil)
delete
delete
, set(value)
set(&)
set

Instance methods inherited from module JSON::OnSteroids::Searchable

dig(key : String) : JSON::OnSteroids dig, dig?(key : String) : JSON::OnSteroids? dig?, path(arr = [] of String) path

Instance methods inherited from module JSON::OnSteroids::Access

<<(value) <<, [](key : Int)
[](key : String)
[]
, []=(key : String, value)
[]=(key : Int, value)
[]=
, []?(key : String) []?, create_arr(key : String | Int) create_arr, create_obj(key : String | Int) create_obj, fetch(key : String, &) fetch

Constructor Detail

def self.new(container : NamedTuple | Array | Hash, parent = nil, key = nil) #

[View source]
def self.new(json_any : JSON::OnSteroids, parent = nil, key = nil) #

[View source]
def self.new(json_any : JSON::Any, parent = nil, key = nil) #

Initialize by passing a JSON::Any object


[View source]
def self.new(raw : WrappedPrimitive, parent = nil, key = nil) #

Basic initalization with a primitive


[View source]
def self.new(**tuple) #

[View source]

Class Method Detail

def self.parse(s : String) #

[View source]

Instance Method Detail

def as_arr #

[View source]
def as_arr? #

[View source]
def as_b #

[View source]
def as_b? #

[View source]
def as_f #

[View source]
def as_f32 #

[View source]
def as_f64 #

[View source]
def as_h #

[View source]
def as_h? #

[View source]
def as_i #

[View source]
def as_i32 #

[View source]
def as_i64 #

[View source]
def as_nil #

[View source]
def as_nil? #

[View source]
def as_number? #

[View source]
def as_s #

[View source]
def as_s? #

[View source]
def as_t #

[View source]
def as_t? #

[View source]
def inspect(io) #

[View source]
def key : Union(String, Int32, Nil) #

Key for this object, if any. String if it belongs to an hash, integer if it belongs to an array if the element is root, key is set to nil.


[View source]
def parent : JSON::OnSteroids? #

The path to the parent if any


[View source]
def raw : RawWrappedValue #

The raw data stored into this wrapper


[View source]
def to_json #

[View source]
def to_s(io) #

[View source]
def wrap(tuple : NamedTuple) #

[View source]
def wrap(array : Array(T)) forall T #

[View source]
def wrap(hash : Hash(String, _)) #

[View source]