class

Chivi::Dict

Inherits Enumerable < Reference < Object

Constants

EPOCH = Time.utc(2020, 1, 1)
SEP_0 = "ǁ"
SEP_1 = "¦"

Constructors

load(file : String) : Dict
Source
new(file : String, preload : Bool = true)
Source

Class methods

dicts
Source
load!(file : String)
Source

Instance methods

[]=(item : Item)
Source
[]?(key)
Source
del(key : String, extra : String | Nil = nil)
Source
each

Must yield this collection's elements to the block.

Source
file
Source
find(key : String) : Item | Nil
Source
includes?(key)

Returns true if the collection contains obj, false otherwise.

[1, 2, 3].includes?(2) # => true
[1, 2, 3].includes?(5) # => false
Source
load!(file : String = @file) : Dict
Source
mtime
Source
put(key : String, vals : String | Array(String), extra : String | Nil = nil)
Source
put(new_item : Item) : Item | Nil
Source
save!(file : String = @file)
Source
scan(chars : Array(Char) | String, offset : Int32 = 0)
Source
set(key : String, vals : String | Array(String), extra : String | Nil = nil)
Source
size

Returns the number of elements in the collection.

[1, 2, 3, 4].size # => 4
Source
trie
Source

Nested types