class ExpiringHash(KeyT, ValueT)

Defined in:

expiring_hash.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(max_items : Int32 | Nil, expiry_period : Time::Span) #

create a new expiring hash


[View source]

Instance Method Detail

def [](key : KeyT) : ValueT #

[View source]
def []=(key : KeyT, value : ValueT) #

[View source]
def []?(key : KeyT) : ValueT | Nil #

[View source]
def expiry_period : Time::Span #

hash properties


[View source]
def expiry_period=(expiry_period : Time::Span) #

hash properties


[View source]
def hash : Hash(KeyT, Tuple(Time, ValueT)) #

backing hash


[View source]
def hash=(hash : Hash(KeyT, Tuple(Time, ValueT))) #

backing hash


[View source]
def max_items : Int32 | Nil #

[View source]
def max_items=(max_items : Int32 | Nil) #

[View source]