Skip to content

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 #clear : Nil#

Removes all of this bag's data.

View source

abstract #empty? : Bool#

Returns true if this bag has no data to persist, otherwise false.

View source

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.

View source

abstract #name : String#

Returns the name of this bag, used to retrieve it via AHTTP::Session#bag.

View source

abstract #storage_key : String#

Returns the key this bag's data is persisted under within the session.

View source

abstract #to_json(builder : JSON::Builder) : Nil#

Writes this bag's data to the provided builder, to be persisted under #storage_key.

View source