class Chivi::Dict

Included Modules

Defined in:

chivi/dict.cr

Constant Summary

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

Constructors

Class Method Summary

Instance Method Summary

Constructor Detail

def self.load(file : String) : Dict #

[View source]
def self.new(file : String, preload : Bool = true) #

[View source]

Class Method Detail

def self.dicts #

[View source]
def self.load!(file : String) #

[View source]

Instance Method Detail

def []=(item : Item) #

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

[View source]
def del(key : String, extra : String | Nil = nil) #

[View source]
def each(&) #
Description copied from module Enumerable(Chivi::Dict::Item)

Must yield this collection's elements to the block.


[View source]
def file : String #

[View source]
def find(key : String) : Item | Nil #

[View source]
def includes?(key) #
Description copied from module Enumerable(Chivi::Dict::Item)

Returns true if the collection contains obj, false otherwise.

[1, 2, 3].includes?(2) # => true
[1, 2, 3].includes?(5) # => false

[View source]
def load!(file : String = @file) : Dict #

[View source]
def mtime : Time #

[View source]
def put(key : String, vals : String | Array(String), extra : String | Nil = nil) #

[View source]
def put(new_item : Item) : Item | Nil #

[View source]
def save!(file : String = @file) #

[View source]
def scan(chars : Array(Char) | String, offset : Int32 = 0) #

[View source]
def set(key : String, vals : String | Array(String), extra : String | Nil = nil) #

[View source]
def size : Int32 #
Description copied from module Enumerable(Chivi::Dict::Item)

Returns the number of elements in the collection.

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

[View source]
def trie : Leaf #

[View source]