class

JSON::OnSteroids

Inherits JSON::OnSteroids::MergeOperations / JSON::OnSteroids::Dirty / JSON::OnSteroids::InPlace / JSON::OnSteroids::Searchable / JSON::OnSteroids::Access / Reference / Object

Handle JSON into a mutable structure, and much more.

Constants

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

Constructors

new(container : NamedTuple | Array | Hash, parent : Nil | JSON::OnSteroids = nil, key : Int32 | String | Nil = nil)
new(json_any : JSON::OnSteroids, parent : Nil | JSON::OnSteroids = nil, key : Int32 | String | Nil = nil)
new(json_any : JSON::Any, parent : Nil | JSON::OnSteroids = nil, key : Int32 | String | Nil = nil)

Initialize by passing a JSON::Any object

new(raw : WrappedPrimitive, parent : Nil | JSON::OnSteroids = nil, key : Int32 | String | Nil = nil)

Basic initalization with a primitive

new

Class methods

parse(s : String)

Instance methods

as_arr
as_arr?
as_b
as_b?
as_f
as_f32
as_f64
as_h
as_h?
as_i
as_i32
as_i64
as_nil
as_nil?
as_number?
as_s
as_s?
as_t
as_t?
inspect(io)
key

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.

parent

The path to the parent if any

raw

The raw data stored into this wrapper

to_json
to_s(io)
wrap(hash : Hash(String, _))
wrap(array : Array(T)) forall T
wrap(tuple : NamedTuple)

Nested types