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

Instance Method Summary

Macro Summary

Constructor Detail

def self.new(raw) #

[View source]

Class Method Detail

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

[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? #

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? #

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? #

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


[View source]
def as_f? : Float64? #

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? #

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


[View source]
def as_i? : Int32? #

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? #

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? #

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 string representation of this object.

Descendants must usually not override this method. Instead, they must override #to_s(io), which must append to the given IO object.


[View source]

Macro Detail

macro method_missing(call) #

[View source]