module HashFile

Overview

HashFile stores data into a file

Extended Modules

Defined in:

hash_file.cr
hash_file/version.cr

Constant Summary

VERSION = "0.6.0"

Instance Method Summary

Instance Method Detail

def [](key : String) #

get value for a given key


[View source]
def []=(key : String, value : String | Number | Time) #

set value for a given key


[View source]
def clear #

flush files from disk


[View source]
def config(options : Hash(String, String | Number) = {} of String => String | Int32) #

overwrite default configuation settings spread: the amount of sub directories to transform the key hash into base_dir: where should your cache be located


[View source]
def delete(key : String) #

delete a key


[View source]
def expired?(key : String) #

check if a key is expired


[View source]
def fetch(key : String, options : Hash(String, String | Int32 | Time)) #

get value for a given key.


[View source]
def key?(value : String) #

does your key exists


[View source]
def store(key : String, value : String | Number | Time, options : Hash(String, String | Int32 | Time)) #

set value for a given key


[View source]
def to_filename(value : String, ommit_base_dir : Bool = false) #

converts a key into a hash


[View source]