struct MaxMindDB::Any

Defined in:

maxminddb/any.cr

Constructors

Instance Method Summary

Instance methods inherited from struct Value

==(other : MaxMindDB::Any) ==

Instance methods inherited from class Object

===(other : MaxMindDB::Any) ===

Constructor Detail

def self.new(raw : Type) #

[View source]

Instance Method Detail

def [](index_or_key : Int | String | Symbol) : Any #

Assumes the underlying value is an Array or Hash and returns the element at the given index_or_key. Raises if the underlying value is not an Array nor a Hash.


[View source]
def []?(index_or_key : Int | String | Symbol) : Any | Nil #

Assumes the underlying value is an Array or Hash and returns the element at the given index_or_key, or nil if out of bounds or the key is missing. Raises if the underlying value is not an Array nor a Hash.


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

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

[View source]
def as_bool : Bool #

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

[View source]
def as_f : Float64 #

[View source]
def as_f32 : Float32 #

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

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

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

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

[View source]
def as_i : Int32 #

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

[View source]
def as_nil : Nil #

[View source]
def as_s : String #

[View source]
def as_s? : String | Nil #

[View source]
def as_u : UInt32 #

[View source]
def as_u128 : UInt128 #

[View source]
def as_u128? : UInt128 | Nil #

[View source]
def as_u16 : UInt16 #

[View source]
def as_u16? : UInt16 | Nil #

[View source]
def as_u64 : UInt64 #

[View source]
def as_u64? : UInt64 | Nil #

[View source]
def as_u? : UInt32 | Nil #

[View source]
def empty? #

[View source]
def found? #

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

See Object#hash(hasher)


[View source]
def inspect(io) #

[View source]
def raw : Type #

[View source]
def size : Int #

Assumes the underlying value is an Array or Hash and returns its size. Raises if the underlying value is not an Array or Hash.


[View source]
def to_json(json : ::JSON::Builder) #

[View source]