class Rack::State::Manager

The Application Interface

Orchestrates the state management of an object. The API is very simple: you can get, set, and delete an object.

The application can access Manager via the Rack environment. See the key middleware option in Rack::State.new.

Public Instance Methods

delete() click to toggle source

Remove object from store and delete associated token on client.

# File lib/rack/state.rb, line 124
def delete
  set false
end
get() click to toggle source

Return object if it exists in store, otherwise nil.

# File lib/rack/state.rb, line 114
def get
  object
end
set(object) click to toggle source

Save object in store and set associated token on client.

# File lib/rack/state.rb, line 119
def set(object)
  @object = object
end