struct Totem::Any

Overview

Totem::Any is a convenient wrapper around all possible types(Totem::Any::Type) and can be used for traversing dynamic or unkown types.

Defined in:

totem/any.cr

Constructors

Instance Method Summary

Instance methods inherited from struct Value

==(other : Totem::Any) ==

Instance methods inherited from class Object

===(other : Totem::Any) ===

Constructor Detail

def self.new(raw : Array(_)) #

[View source]
def self.new(raw : Hash(String, _)) #

[View source]
def self.new(raw : Type) #

[View source]
def self.new(raw : Any) #

[View source]

Instance Method Detail

def ==(other : Totem::Any) #

Returns true if both self and other's raw object are equal.


[View source]
def ==(other) #

Returns true if the raw object is equal to other.


[View source]
def [](key : Int) : Any #

[View source]
def [](key : String) : Any #

[View source]
def []=(key : String, value : _) #

[View source]
def []?(key : Int) : Any | Nil #

[View source]
def []?(key : String) : Any | Nil #

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

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

[View source]
def as_bool #

[View source]
def as_bool? #

[View source]
def as_f #

[View source]
def as_f32 #

[View source]
def as_f32? #

[View source]
def as_f? #

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

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

[View source]
def as_i #

[View source]
def as_i64 #

[View source]
def as_i64? #

[View source]
def as_i? #

[View source]
def as_nil : Nil #

[View source]
def as_s #

[View source]
def as_s? #

[View source]
def as_time(timezone : Time::Location | Nil = nil) #

[View source]
def as_time?(timezone : Time::Location | Nil = nil) #

[View source]
def clone #

[View source]
def dup #
Description copied from struct Value

Returns a shallow copy of this object.

Because Value is a value type, this method returns self, which already involves a shallow copy of this object because value types are passed by value.


[View source]
def hash(hasher) #

See Object#hash(hasher)


[View source]
def raw : Type #

[View source]
def size : Int #

[View source]