class Tourmaline::HashPersistence

Overview

Stores all persisted data in memory using a collection of hash tables.

Direct Known Subclasses

Defined in:

tourmaline/persistence/hash_persistence.cr

Constructors

Instance Method Summary

Instance methods inherited from class Tourmaline::Persistence

chat_exists?(chat_id : Int) : Bool
chat_exists?(username : String) : Bool
chat_exists?
, get_chat(chat_id : Int) : Chat | Nil
get_chat(username : String) : Chat | Nil
get_chat
, get_user(user_id : Int) : User | Nil
get_user(username : String) : User | Nil
get_user
, handle_persistent_update(update : Update) handle_persistent_update, persistent_cleanup persistent_cleanup, persistent_init persistent_init, update_chat(chat : Chat) : Chat update_chat, update_user(user : User) : User update_user, user_exists?(user_id : Int) : Bool
user_exists?(usename : String) : Bool
user_exists?

Constructor Detail

def self.new(filename = nil) #

[View source]

Instance Method Detail

def chat_exists?(chat_id : Int) : Bool #

[View source]
def chat_exists?(username : String) : Bool #

[View source]
def filename : String #

[View source]
def get_chat(chat_id : Int) : Chat | Nil #

[View source]
def get_chat(username : String) : Chat | Nil #

[View source]
def get_user(user_id : Int) : User | Nil #

[View source]
def get_user(username : String) : User | Nil #

[View source]
def handle_persistent_update(update : Update) #

[View source]
def persisted_chat_ids : Hash(String, Int64) #

[View source]
def persisted_chats : Hash(Int64, Tourmaline::Chat) #

[View source]
def persisted_user_ids : Hash(String, Int64) #

[View source]
def persisted_users : Hash(Int64, Tourmaline::User) #

[View source]
def persistent_cleanup #

[View source]
def persistent_init #

[View source]
def update_chat(chat : Chat) : Chat #

[View source]
def update_user(user : User) : User #

[View source]
def user_exists?(user_id : Int) : Bool #

[View source]
def user_exists?(username : String) : Bool #

[View source]