class Hash(K, V)

Superclass hierarchy

Object
Reference
Hash(K, V)

Defined in:

Class Method Summary

Instance Method Summary

Class Method Detail

def self.new(pull : JSON::PullParser)

def self.new(comparator)

def self.new(comp = StandardComparator, &block : Hash(K, V), K -> V)

def self.new(default_value : V, comp = StandardComparator)

def self.zip(ary1 : Array(K), ary2 : Array(V))

def self.new(block = nil : Hash(K, V), K -> V | Nil, comp = StandardComparator)

Instance Method Detail

def ==(other : Hash)

def [](key)

def []=(key : K, value : V)

def []?(key)

def clear

def clone

def delete(key)

def delete_if(&block)

def dup

def each(&block)

def each

def each_key

def each_key(&block)

def each_value

def each_value(&block)

def each_with_index(&block)

def empty?

def fetch(key)

def fetch(key, default)

def fetch(key, &block)

def first

def first_key

def first_key?

def first_value

def first_value?

def has_key?(key)

def hash

def inspect(io : IO)

def invert

def key_index(key)

def keys

def length

def map(&block : K, V -> U)

def merge(other : Hash(L, W), &block : K, V, W -> V | W)

def merge(other : Hash(L, W))

def merge!(other : Hash(K, V), &block : K, V, V -> V)

def merge!(other : Hash(K, V))

def rehash

def shift

def shift(&block)

def shift?

def size

def to_a

def to_h

def to_json(io)

def to_s(io : IO)

def values

def values_at(*indexes : K)

Returns a tuple populated with the elements at the given indexes. Raises if any index is invalid.

{"a": 1, "b": 2, "c": 3, "d": 4}.values_at("a", "c") #=> {1, 3}