struct Cassandra::DBApi::Any

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.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(raw : Type) #

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


[View source]

Instance Method Detail

def ==(other : Any) #

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


[View source]
def ==(other) #

Compares the raw value to the given value.


[View source]
def as_a : Array(Any) #

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


[View source]
def as_a? : Array(Any)? #

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


[View source]
def as_bool : Bool #

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


[View source]
def as_bool? : Bool? #

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


[View source]
def as_bytes : Bytes #

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


[View source]
def as_bytes? : Bytes? #

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


[View source]
def as_date : DBApi::Date #

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


[View source]
def as_date? : DBApi::Date? #

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


[View source]
def as_f32 : Float32 #

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


[View source]
def as_f32? : Float32? #

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


[View source]
def as_f64 : Float64 #

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


[View source]
def as_f64? : Float64? #

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


[View source]
def as_h : Hash(Any, Any) #

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


[View source]
def as_h? : Hash(Any, Any)? #

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


[View source]
def as_i16 : Int16 #

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


[View source]
def as_i16? : Int16? #

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


[View source]
def as_i32 : Int32 #

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


[View source]
def as_i32? : Int32? #

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


[View source]
def as_i64 : Int64 #

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


[View source]
def as_i64? : Int64? #

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


[View source]
def as_i8 : Int8 #

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


[View source]
def as_i8? : Int8? #

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


[View source]
def as_nil #

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


[View source]
def as_s : String #

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


[View source]
def as_s? : String? #

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


[View source]
def as_set : Set(Any) #

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


[View source]
def as_set? : Set(Any)? #

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


[View source]
def as_time : DBApi::Time #

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


[View source]
def as_time? : DBApi::Time? #

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


[View source]
def as_timestamp : ::Time #

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


[View source]
def as_timestamp? : ::Time? #

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


[View source]
def as_timeuuid : DBApi::TimeUuid #

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


[View source]
def as_timeuuid? : DBApi::TimeUuid? #

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


[View source]
def as_uuid : DBApi::Uuid #

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


[View source]
def as_uuid? : DBApi::Uuid? #

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


[View source]
def raw : Type #

Returns the raw underlying value.


[View source]