class DotPrison::Table

Overview

AKA a Lua table / HashMap. String keys to String or Table values. Values can also be arrays of Strings or Tables.

Defined in:

dot_prison/builder.cr
dot_prison/table.cr
dot_prison/to_prison.cr

Class Method Summary

Instance Method Summary

Instance methods inherited from class Object

to_prison to_prison

Class Method Detail

def self.build(&) : DotPrison::Table #

[View source]

Instance Method Detail

def ==(other : self) #
Description copied from class Reference

Returns true if this reference is the same as other. Invokes same?.


[View source]
def [](k) #

[View source]
def []=(k : Symbol, v) #

[View source]
def []=(k, v) #

[View source]
def []?(k) #

[View source]
def add(k : String, v : String) : self #

[View source]
def add(k : String, v : Table) : self #

[View source]
def add(k : Symbol, v : String) : self #

[View source]
def add(k : Symbol, v : Table) : self #

[View source]
def each(*args, **options) #

[View source]
def each(*args, **options, &) #

[View source]
def empty? #

[View source]
def parse_bool(key : String | Symbol, default_value : Bool = false) : Bool #

Return the Bool at key. On non-Bool or missing value, returns default_value


[View source]
def parse_bool!(key : String | Symbol) : Bool #

Return the Bool at key or raises KeyError on non-Bool or missing.


[View source]
def parse_bool?(key : String | Symbol) : Bool | Nil #

Return the Bool at key or nil on non-bool or missing


[View source]
def parse_float(key : String | Symbol, default_value : Float64 = 0.0) : Float64 #

Return the Float64 at key. On non-Float or missing value, returns default_value


[View source]
def parse_float!(key : String | Symbol) : Float64 #

Return the Float64 at key or raises KeyError on non-Float or missing


[View source]
def parse_float?(key : String | Symbol) : Float64 | Nil #

Return the Float64 at key or nil on non-Float or missing


[View source]
def parse_int(key : String | Symbol, default_value : Int32 = 0) : Int32 #

Return the Int32 at key. On non-Int or missing value, returns default_value


[View source]
def parse_int!(key : String | Symbol) : Int32 #

Return the Int32 at key or raises KeyError on non-Int or missing


[View source]
def parse_int?(key : String | Symbol) : Int32 | Nil #

Return the Int32 at key or nil on non-Int or missing


[View source]
def parse_string(key : String | Symbol, default_value : String = "") : String #

Return the String at key. On non-String or missing value, returns default_value


[View source]
def parse_string!(key : String | Symbol) : String #

Return the String at key or KeyError on non-String or missing


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

Return the String at key or nil on non-String or missing


[View source]
def parse_string_array(key : String | Symbol) : Array(String) #

Return the Array(String) at key. On String value, replaces the value with a Array(String) containing the String. On invalid or missing values, a new Array(String) is set and returned.


[View source]
def parse_string_array!(key : String | Symbol) : Array(String) #

Return the Array(String) at key. On String, replaces with an Array(String). Raises KeyError on other values or missing.


[View source]
def parse_string_array?(key : String | Symbol) : Array(String) | Nil #

Return the Array(String) at key. On String, replaces with an Array(String) Returns nil on other values or missing.


[View source]
def parse_table(key : String | Symbol) : Table #

Return the Table at key. On non-Table or missing value, sets and returns a new Table


[View source]
def parse_table!(key : String | Symbol) : Table #

Return the Table at key or KeyError on non-String or missing


[View source]
def parse_table?(key : String | Symbol) : Table | Nil #

Return the Table at key or nil on non-Table or missing


[View source]
def parse_table_array(key : String | Symbol) : Array(Table) #

Return the Array(Table) at key. On single Table, replaces the value with a Array(Table) containing the Table. On invalid or missing values, a new Array(Table) is set and returned


[View source]
def parse_table_array!(key : String | Symbol) : Array(Table) #

Return the Array(Table) at key. On Table, replaces with an Array(Table). Raises KeyError on other values or missing


[View source]
def parse_table_array?(key : String | Symbol) : Array(Table) | Nil #

Return the Array(Table) at key. On Table, replaces with an Array(Table). Returns nil on other values or missing


[View source]
def size #

[View source]
def to_prison(io : IO, indent = 0) #

[View source]