struct Crysda::AnyVal
- Crysda::AnyVal
- Struct
- Value
- Object
Overview
Wrapper around Any
and provide convenient methods like as_xxx
to access the value in specific format.
Defined in:
crysda/utils.crConstructors
Class Method Summary
Instance Method Summary
- #==(other : self)
-
#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_df : DataFrame
Checks that the underlying value is
DataFrame
, and returns its value. -
#as_df? : DataFrame | Nil
Checks that the underlying value is
DataFrame
, and returns its value. -
#as_f : Float64
Checks that the underlying value is
Float
, and returns its value as anFloat64
. -
#as_f32 : Float32
Checks that the underlying value is
Float
, and returns its value as anFloat32
. -
#as_f32? : Float32 | Nil
Checks that the underlying value is
Float
, and returns its value as anFloat32
. -
#as_f? : Float64 | Nil
Checks that the underlying value is
Float
, and returns its value as anFloat64
. -
#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. -
#as_t : Time
Checks that the underlying value is
Time
, and returns its value. -
#as_t? : Time | Nil
Checks that the underlying value is
Time
, and returns its value. -
#hash(hasher)
See
Object#hash(hasher)
- #raw : Any | DataFrame
-
#to_s(io : IO) : Nil
Same as
#inspect(io)
. -
#to_s
Returns a nicely readable and concise string representation of this object, typically intended for users.
Macro Summary
Constructor Detail
Class Method Detail
Instance Method Detail
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 DataFrame
, and returns its value.
Raises otherwise.
Checks that the underlying value is DataFrame
, and returns its value.
Returns nil
otherwise.
Checks that the underlying value is Float
, and returns its value as an Float64
.
Raises otherwise.
Checks that the underlying value is Float
, and returns its value as an Float32
.
Raises otherwise.
Checks that the underlying value is Float
, and returns its value as an Float32
.
Returns nil
otherwise.
Checks that the underlying value is Float
, and returns its value as an Float64
.
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.
Checks that the underlying value is Time
, and returns its value.
Raises otherwise.
Checks that the underlying value is Time
, and returns its value.
Returns nil
otherwise.
Returns a nicely readable and concise string representation of this object, typically intended for users.
This method should usually not be overridden. It delegates to
#to_s(IO)
which can be overridden for custom implementations.
Also see #inspect
.