class Lua::Table

Included Modules

Defined in:

crystal-lua/base.cr

Instance Method Summary

Instance methods inherited from class Lua::Base

ref : Int32 ref, ref? : Int32 | Nil ref?

Constructor methods inherited from class Lua::Base

new(state : State, ref : Int32 | Nil) new

Instance Method Detail

def [](index : Any::Type) : Any | Nil #

[View source]
def []=(index : Any::Type, value : Any::Type) : Any::Type #

[View source]
def each(& : Tuple(Any, Any) -> ) #
Description copied from module Enumerable({Lua::Any, Lua::Any})

Must yield this collection's elements to the block.


[View source]
def to_h : Hash(Any, Any) #
Description copied from module Enumerable({Lua::Any, Lua::Any})

Creates a Hash out of an Enumerable where each element is a 2 element structure (for instance a Tuple or an Array).

[[:a, :b], [:c, :d]].to_h        # => {:a => :b, :c => :d}
Tuple.new({:a, 1}, {:c, 2}).to_h # => {:a => 1, :c => 2}

[View source]