class HTTPSession::Storage::Memory(T)

Defined in:

storage/memory.cr

Instance Method Summary

Instance methods inherited from class HTTPSession::Storage(T)

[](session_id : String) : T | Nil [], []=(session_id : String, session : T) : Nil []=, delete_expired(min : Time) : Nil delete_expired, fetch(session_id : String) : Entry(T) | Nil fetch, gc_interval : Time::Span gc_interval, gc_interval=(gc_interval : Time::Span) gc_interval=, max_age : Time::Span max_age, max_age=(max_age : Time::Span) max_age=, put(session_id : String, entry : Entry(T)) : Nil put, run_gc_loop run_gc_loop

Instance methods inherited from module HTTPSession::StorageInterface(T)

[](session_id : String) : T | Nil [], []=(session_id : String, session : T) : Nil []=, delete(session_id : String) : Nil delete, has?(session_id : String) : Bool has?, new_session_id : String new_session_id

Instance Method Detail

def delete(session_id : String) : Nil #
Description copied from module HTTPSession::StorageInterface(T)

Deletes the storage value for session_id.


[View source]
def delete_expired(min : Time) : Nil #
Description copied from class HTTPSession::Storage(T)

Deletes all expired storage values, i.e. which have not been touched since time.


[View source]
def fetch(session_id : String) : Entry(T) | Nil #
Description copied from class HTTPSession::Storage(T)

Fetches an entry indicated by session_id. Returns nil if no entry exists.


[View source]
def new_session_id : String #

Generates a new unused session_id.

This is a basic implementation


[View source]
def put(session_id : String, entry : Entry(T)) : Nil #
Description copied from class HTTPSession::Storage(T)

Sets the entry for session_id.


[View source]