struct Cassandra::DBApi::Any
- Cassandra::DBApi::Any
- Struct
- Value
- Object
Overview
Wraps any possible Cassandra value. It can be supplied as a parameter for a query or be returned as a result. It dynamically handles values with actual types decided at runtime.
Cassandra::DBApi::Any
serves a similar purpose as
JSON::Any
.
In order to obtain the actual value use the as_*
methods which perform
type checks against the raw underlying value.
Defined in:
cassandra/dbapi.crConstructors
-
.new(raw : Type)
Creates a
Cassandra::DBApi::Any
that wraps the given value.
Instance Method Summary
- #==(other : Any)
-
#==(other)
Compares the raw value to the given value.
-
#as_a : Array(Any)
Checks that the underlying value is
Array(Any)
, and returns its value. -
#as_a? : Array(Any)?
Checks that the underlying value is
Array(Any)
, and returns its value. -
#as_bool : Bool
Checks that the underlying value is
Bool
, and returns its value. -
#as_bool? : Bool?
Checks that the underlying value is
Bool
, and returns its value. -
#as_bytes : Bytes
Checks that the underlying value is
Bytes
, and returns its value. -
#as_bytes? : Bytes?
Checks that the underlying value is
Bytes
, and returns its value. -
#as_date : DBApi::Date
Checks that the underlying value is
DBApi::Date
, and returns its value. -
#as_date? : DBApi::Date?
Checks that the underlying value is
DBApi::Date
, and returns its value. -
#as_f32 : Float32
Checks that the underlying value is
Float32
, and returns its value. -
#as_f32? : Float32?
Checks that the underlying value is
Float32
, and returns its value. -
#as_f64 : Float64
Checks that the underlying value is
Float64
, and returns its value. -
#as_f64? : Float64?
Checks that the underlying value is
Float64
, and returns its value. - #as_h : Hash(Any, Any)
- #as_h? : Hash(Any, Any)?
-
#as_i16 : Int16
Checks that the underlying value is
Int16
, and returns its value. -
#as_i16? : Int16?
Checks that the underlying value is
Int16
, and returns its value. -
#as_i32 : Int32
Checks that the underlying value is
Int32
, and returns its value. -
#as_i32? : Int32?
Checks that the underlying value is
Int32
, and returns its value. -
#as_i64 : Int64
Checks that the underlying value is
Int64
, and returns its value. -
#as_i64? : Int64?
Checks that the underlying value is
Int64
, and returns its value. -
#as_i8 : Int8
Checks that the underlying value is
Int8
, and returns its value. -
#as_i8? : Int8?
Checks that the underlying value is
Int8
, and returns its value. -
#as_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?
Checks that the underlying value is
String
, and returns its value. -
#as_set : Set(Any)
Checks that the underlying value is
Set(Any)
, and returns its value. -
#as_set? : Set(Any)?
Checks that the underlying value is
Set(Any)
, and returns its value. -
#as_time : DBApi::Time
Checks that the underlying value is
DBApi::Time
, and returns its value. -
#as_time? : DBApi::Time?
Checks that the underlying value is
DBApi::Time
, and returns its value. -
#as_timestamp : ::Time
Checks that the underlying value is
::Time
, and returns its value. -
#as_timestamp? : ::Time?
Checks that the underlying value is
::Time
, and returns its value. -
#as_timeuuid : DBApi::TimeUuid
Checks that the underlying value is
DBApi::TimeUuid
, and returns its value. -
#as_timeuuid? : DBApi::TimeUuid?
Checks that the underlying value is
DBApi::TimeUuid
, and returns its value. -
#as_uuid : DBApi::Uuid
Checks that the underlying value is
DBApi::Uuid
, and returns its value. -
#as_uuid? : DBApi::Uuid?
Checks that the underlying value is
DBApi::Uuid
, and returns its value. -
#raw : Type
Returns the raw underlying value.
Constructor Detail
Creates a Cassandra::DBApi::Any
that wraps the given value.
Instance Method Detail
Checks that the underlying value is Array(Any)
, and returns its value.
Raises otherwise.
Checks that the underlying value is Array(Any)
, 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 Bytes
, and returns its value.
Raises otherwise.
Checks that the underlying value is Bytes
, and returns its value.
Returns nil
otherwise.
Checks that the underlying value is DBApi::Date
, and returns its value.
Raises otherwise.
Checks that the underlying value is DBApi::Date
, and returns its value.
Returns nil
otherwise.
Checks that the underlying value is Float32
, and returns its value.
Raises otherwise.
Checks that the underlying value is Float32
, and returns its value.
Returns nil
otherwise.
Checks that the underlying value is Float64
, and returns its value.
Raises otherwise.
Checks that the underlying value is Float64
, and returns its value.
Returns nil
otherwise.
Checks that the underlying value is Int16
, and returns its value.
Raises otherwise.
Checks that the underlying value is Int16
, and returns its value.
Returns nil
otherwise.
Checks that the underlying value is Int32
, and returns its value.
Raises otherwise.
Checks that the underlying value is Int32
, and returns its value.
Returns nil
otherwise.
Checks that the underlying value is Int64
, and returns its value.
Raises otherwise.
Checks that the underlying value is Int64
, and returns its value.
Returns nil
otherwise.
Checks that the underlying value is Int8
, and returns its value.
Raises otherwise.
Checks that the underlying value is Int8
, and returns its value.
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 Set(Any)
, and returns its value.
Raises otherwise.
Checks that the underlying value is Set(Any)
, and returns its value.
Returns nil
otherwise.
Checks that the underlying value is DBApi::Time
, and returns its value.
Raises otherwise.
Checks that the underlying value is DBApi::Time
, 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.
Checks that the underlying value is DBApi::TimeUuid
, and returns its value.
Raises otherwise.
Checks that the underlying value is DBApi::TimeUuid
, and returns its value.
Returns nil
otherwise.
Checks that the underlying value is DBApi::Uuid
, and returns its value.
Raises otherwise.
Checks that the underlying value is DBApi::Uuid
, and returns its value.
Returns nil
otherwise.