abstract class Marten::HTTP::Session::Store::Base
- Marten::HTTP::Session::Store::Base
- Reference
- Object
Overview
Abstract base session store.
Direct Known Subclasses
Defined in:
marten/http/session/store/base.crConstructors
Instance Method Summary
-
#[](key : String | Symbol)
Returns the value associated with the passed key or raises a
KeyError
exception if not found. -
#[]=(key : String | Symbol, value : String)
Allows to set a new session value for a specific
key
. -
#[]?(key : String | Symbol)
Returns the value associated with the passed key or returns
nil
if not found. -
#accessed? : Bool
Returns
true
if the session store was accessed at least once. - #clear_expired_entries : Nil
-
#create : Nil
Creates a new session store.
-
#cycle_key : Nil
Regenerates the session key while keeping all the existing data.
-
#delete(key : String | Symbol)
Allows to delete a session value for a specific
key
. - #each(*args, **options)
- #each(*args, **options, &)
-
#empty? : Bool
Returns
true
if the session store is empty. -
#fetch(key : String | Symbol, default = nil)
Returns the value associated with the passed
key
, or the passeddefault
if the key is not found. -
#fetch(key : String | Symbol, &)
Returns the value associated with the passed
key
, or calls a block with the key when not found. -
#flush : Nil
Flushes the session store data.
-
#has_key?(key : String | Symbol)
Returns
true
if the providedkey
exists. -
#load : SessionHash
Loads the session store data and returns the corresponding hash.
-
#modified? : Bool
Returns
true
if the session store was modified. -
#save : Nil
Saves the session store data.
- #session_key : String?
-
#size(*args, **options)
Returns the number of keys in the session hash.
-
#size(*args, **options, &)
Returns the number of keys in the session hash.
Constructor Detail
Instance Method Detail
Returns the value associated with the passed key or raises a KeyError
exception if not found.
Allows to set a new session value for a specific key
.
Returns the value associated with the passed key or returns nil
if not found.
Creates a new session store.
This method should create a new (empty) session store with an associated key and persist it.
Returns the value associated with the passed key
, or the passed default
if the key is not found.
Returns the value associated with the passed key
, or calls a block with the key when not found.