struct

Cassandra::DBApi::Any

Inherits Struct / Value / Object

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.

Constructors

new(raw : Type)

Creates a Cassandra::DBApi::Any that wraps the given value.

Source

Instance methods

==(other : Any)

Compares this Any to the given Any by comparing their values.

Source
==(other)

Compares the raw value to the given value.

Source
as_a

Checks that the underlying value is Array(Any), and returns its value. Raises otherwise.

Source
as_a?

Checks that the underlying value is Array(Any), and returns its value. Returns nil otherwise.

Source
as_bool

Checks that the underlying value is Bool, and returns its value. Raises otherwise.

Source
as_bool?

Checks that the underlying value is Bool, and returns its value. Returns nil otherwise.

Source
as_bytes

Checks that the underlying value is Bytes, and returns its value. Raises otherwise.

Source
as_bytes?

Checks that the underlying value is Bytes, and returns its value. Returns nil otherwise.

Source
as_date

Checks that the underlying value is DBApi::Date, and returns its value. Raises otherwise.

Source
as_date?

Checks that the underlying value is DBApi::Date, and returns its value. Returns nil otherwise.

Source
as_f32

Checks that the underlying value is Float32, and returns its value. Raises otherwise.

Source
as_f32?

Checks that the underlying value is Float32, and returns its value. Returns nil otherwise.

Source
as_f64

Checks that the underlying value is Float64, and returns its value. Raises otherwise.

Source
as_f64?

Checks that the underlying value is Float64, and returns its value. Returns nil otherwise.

Source
as_h

Checks that the underlying value is Hash(Any, Any), and returns its value. Raises otherwise.

Source
as_h?

Checks that the underlying value is Hash(Any, Any), and returns its value. Returns nil otherwise.

Source
as_i16

Checks that the underlying value is Int16, and returns its value. Raises otherwise.

Source
as_i16?

Checks that the underlying value is Int16, and returns its value. Returns nil otherwise.

Source
as_i32

Checks that the underlying value is Int32, and returns its value. Raises otherwise.

Source
as_i32?

Checks that the underlying value is Int32, and returns its value. Returns nil otherwise.

Source
as_i64

Checks that the underlying value is Int64, and returns its value. Raises otherwise.

Source
as_i64?

Checks that the underlying value is Int64, and returns its value. Returns nil otherwise.

Source
as_i8

Checks that the underlying value is Int8, and returns its value. Raises otherwise.

Source
as_i8?

Checks that the underlying value is Int8, and returns its value. Returns nil otherwise.

Source
as_nil

Checks that the underlying value is Nil, and returns nil. Raises otherwise.

Source
as_s

Checks that the underlying value is String, and returns its value. Raises otherwise.

Source
as_s?

Checks that the underlying value is String, and returns its value. Returns nil otherwise.

Source
as_set

Checks that the underlying value is Set(Any), and returns its value. Raises otherwise.

Source
as_set?

Checks that the underlying value is Set(Any), and returns its value. Returns nil otherwise.

Source
as_time

Checks that the underlying value is DBApi::Time, and returns its value. Raises otherwise.

Source
as_time?

Checks that the underlying value is DBApi::Time, and returns its value. Returns nil otherwise.

Source
as_timestamp

Checks that the underlying value is ::Time, and returns its value. Raises otherwise.

Source
as_timestamp?

Checks that the underlying value is ::Time, and returns its value. Returns nil otherwise.

Source
as_timeuuid

Checks that the underlying value is DBApi::TimeUuid, and returns its value. Raises otherwise.

Source
as_timeuuid?

Checks that the underlying value is DBApi::TimeUuid, and returns its value. Returns nil otherwise.

Source
as_uuid

Checks that the underlying value is DBApi::Uuid, and returns its value. Raises otherwise.

Source
as_uuid?

Checks that the underlying value is DBApi::Uuid, and returns its value. Returns nil otherwise.

Source
raw

Returns the raw underlying value.

Source