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, key = nil)
- .new(json_any : JSON::OnSteroids, parent = nil, key = nil)
-
.new(json_any : JSON::Any, parent = nil, key = nil)
Initialize by passing a JSON::Any object
-
.new(raw : WrappedPrimitive, parent = nil, key = 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?
The path to the parent if any
-
#raw : RawWrappedValue
The raw data stored into this wrapper
- #to_json
- #to_s(io)
- #wrap(tuple : NamedTuple)
- #wrap(array : Array(T)) forall T
- #wrap(hash : Hash(String, _))
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
Initialize by passing a JSON::Any object
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.