class JSON::OnSteroids
- JSON::OnSteroids
- Reference
- Object
Overview
Handle JSON into a mutable structure, and much more.
Included Modules
- JSON::OnSteroids::Access
- JSON::OnSteroids::Dirty
- JSON::OnSteroids::InPlace
- JSON::OnSteroids::MergeOperations
- JSON::OnSteroids::Searchable
Defined in:
json_on_steroids.cr:6json_on_steroids.cr:13
Constant Summary
-
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(**tuple)
Class Method Summary
Instance Method Summary
- #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 : Union(String, Int32, Nil)
Key for this object, if any.
-
#parent : JSON::OnSteroids | Nil
The path to the parent if any
-
#raw : RawWrappedValue
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)
Instance methods inherited from module JSON::OnSteroids::MergeOperations
%(t : Enumerable)
%,
-(t : Enumerable)
-,
merge(x : NamedTuple)
merge,
merge!(x : NamedTuple)
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 | Nil
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 | JSON::OnSteroids = nil, key : Int32 | String | Nil = nil)
#
def self.new(json_any : JSON::OnSteroids, parent : Nil | JSON::OnSteroids = nil, key : Int32 | String | Nil = nil)
#
def self.new(json_any : JSON::Any, parent : Nil | JSON::OnSteroids = nil, key : Int32 | String | Nil = nil)
#
Initialize by passing a JSON::Any object
def self.new(raw : WrappedPrimitive, parent : Nil | JSON::OnSteroids = nil, key : Int32 | String | Nil = nil)
#
Basic initalization with a primitive
Class Method Detail
Instance Method Detail
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.