module Athena::HTTP::Session::BagInterface
#
A named container of session data, persisted under its own #storage_key within the session.
Custom bags can be registered via AHTTP::Session#register_bag.
Direct including types
Athena::HTTP::Session::AttributeBag
Athena::HTTP::Session::FlashBag
Athena::HTTP::Session::Storage::MetadataBag
Methods#
abstract #empty? : Bool#
Returns true if this bag has no data to persist, otherwise false.
abstract #load(pull : JSON::PullParser | Nil) : Nil#
Loads this bag's data from the provided pull parser, positioned at the value persisted under #storage_key.
Resets this bag to empty if pull is nil, i.e. nothing was persisted under it.
abstract #name : String#
Returns the name of this bag, used to retrieve it via AHTTP::Session#bag.
abstract #storage_key : String#
Returns the key this bag's data is persisted under within the session.
abstract #to_json(builder : JSON::Builder) : Nil#
Writes this bag's data to the provided builder, to be persisted under #storage_key.