struct Crysda::AnyVal

Overview

Wrapper around Any and provide convenient methods like as_xxx to access the value in specific format.

Defined in:

crysda/utils.cr

Constructors

Class Method Summary

Macro Summary

Instance Method Summary

Constructor Detail

def self.new(raw : Bool | Crysda::CustomColumnValue | Crysda::DataFrame | Float32 | Float64 | Int32 | Int64 | JSON::Any | String | Time | UUID | Nil) #

[View source]

Class Method Detail

def self.[](val : Any | DataFrame) #

[View source]

Macro Detail

macro method_missing(call) #

[View source]

Instance Method Detail

def ==(other : self) #

def as_bool : Bool #

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


[View source]
def as_bool? : Bool | Nil #

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


[View source]
def as_df : DataFrame #

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


[View source]
def as_df? : DataFrame | Nil #

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


[View source]
def as_f : Float64 #

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


[View source]
def as_f32 : Float32 #

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


[View source]
def as_f32? : Float32 | Nil #

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


[View source]
def as_f? : Float64 | Nil #

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


[View source]
def as_i : Int32 #

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


[View source]
def as_i64 : Int64 #

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


[View source]
def as_i64? : Int64 | Nil #

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


[View source]
def as_i? : Int32 | Nil #

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


[View source]
def as_nil : 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 | Nil #

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


[View source]
def as_t : Time #

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


[View source]
def as_t? : Time | Nil #

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


[View source]
def hash(hasher) #
Description copied from struct Struct

See Object#hash(hasher)


def raw : Any | DataFrame #

[View source]
def to_s(io : IO) : Nil #
Description copied from struct Struct

Same as #inspect(io).


[View source]
def to_s #
Description copied from class Object

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.


[View source]