class RubyJson
- RubyJson
- Reference
- Object
Defined in:
core/anyolite/json.crConstructors
Class Method Summary
Instance Method Summary
-
#[](index : Int | String) : RubyJson
Assumes the underlying value is an
Arrayand returns the element at the given index. -
#[]?(index : Int | String) : RubyJson | Nil
Assumes the underlying value is an
Arrayand returns the element at the given index, ornilif out of bounds. -
#as_a : Array(RubyJson)
Checks that the underlying value is
Array, and returns its value. -
#as_a? : Array(RubyJson) | Nil
Checks that the underlying value is
Array, and returns its value. -
#as_bool : Bool
Checks that the underlying value is
Bool, and returns its value. -
#as_bool? : Bool | Nil
Checks that the underlying value is
Bool, and returns its value. -
#as_f : Float64
Checks that the underlying value is
Float(orInt), and returns its value as anFloat64. -
#as_f32 : Float32
Checks that the underlying value is
Float(orInt), and returns its value as anFloat32. -
#as_f32? : Float32 | Nil
Checks that the underlying value is
Float(orInt), and returns its value as anFloat32. -
#as_f? : Float64 | Nil
Checks that the underlying value is
Float(orInt), and returns its value as anFloat64. -
#as_h : Hash(String, RubyJson)
Checks that the underlying value is
Hash, and returns its value. -
#as_h? : Hash(String, RubyJson) | Nil
Checks that the underlying value is
Hash, and returns its value. -
#as_i : Int32
Checks that the underlying value is
Int, and returns its value as anInt32. -
#as_i64 : Int64
Checks that the underlying value is
Int, and returns its value as anInt64. -
#as_i64? : Int64 | Nil
Checks that the underlying value is
Int, and returns its value as anInt64. -
#as_i? : Int32 | Nil
Checks that the underlying value is
Int, and returns its value as anInt32. -
#as_nil : Nil
Checks that the underlying value is
Nil, and returnsnil. -
#as_s : String
Checks that the underlying value is
String, and returns its value. -
#as_s? : String | Nil
Checks that the underlying value is
String, and returns its value. - #raw=(raw : RubyJsonType)
-
#size : Int
Assumes the underlying value is an
ArrayorHashand returns its size. - #to_jsonany
Constructor Detail
Class Method Detail
Instance Method Detail
Assumes the underlying value is an Array and returns the element
at the given index.
Raises if the underlying value is not an Array.
Assumes the underlying value is an Array and returns the element
at the given index, or nil if out of bounds.
Raises if the underlying value is not an Array.
Checks that the underlying value is Array, and returns its value.
Raises otherwise.
Checks that the underlying value is Array, and returns its value.
Returns nil otherwise.
Checks that the underlying value is Bool, and returns its value.
Raises otherwise.
Checks that the underlying value is Bool, and returns its value.
Returns nil otherwise.
Checks that the underlying value is Float (or Int), and returns its value as an Float64.
Raises otherwise.
Checks that the underlying value is Float (or Int), and returns its value as an Float32.
Raises otherwise.
Checks that the underlying value is Float (or Int), and returns its value as an Float32.
Returns nil otherwise.
Checks that the underlying value is Float (or Int), and returns its value as an Float64.
Returns nil otherwise.
Checks that the underlying value is Hash, and returns its value.
Raises otherwise.
Checks that the underlying value is Hash, and returns its value.
Returns nil otherwise.
Checks that the underlying value is Int, and returns its value as an Int32.
Raises otherwise.
Checks that the underlying value is Int, and returns its value as an Int64.
Raises otherwise.
Checks that the underlying value is Int, and returns its value as an Int64.
Returns nil otherwise.
Checks that the underlying value is Int, and returns its value as an Int32.
Returns nil otherwise.
Checks that the underlying value is String, and returns its value.
Raises otherwise.
Checks that the underlying value is String, and returns its value.
Returns nil otherwise.
Assumes the underlying value is an Array or Hash and returns its size.
Raises if the underlying value is not an Array or Hash.