SessionHash is responsible to lazily load the session from store.

Methods
#
C
D
E
F
H
I
K
L
M
N
O
R
S
T
U
V
Included Modules
Constants
Unspecified = Object.new
 
Attributes
[W] id
Class Public methods
find(req)
# File lib/rack/session/abstract/id.rb, line 23
def self.find(req)
  req.get_header RACK_SESSION
end
new(store, req)
# File lib/rack/session/abstract/id.rb, line 35
def initialize(store, req)
  @store = store
  @req = req
  @loaded = false
end
set(req, session)
# File lib/rack/session/abstract/id.rb, line 27
def self.set(req, session)
  req.set_header RACK_SESSION, session
end
set_options(req, options)
# File lib/rack/session/abstract/id.rb, line 31
def self.set_options(req, options)
  req.set_header RACK_SESSION_OPTIONS, options.dup
end
Instance Public methods
[](key)
# File lib/rack/session/abstract/id.rb, line 55
def [](key)
  load_for_read!
  @data[key.to_s]
end
[]=(key, value)
Also aliased as: store
# File lib/rack/session/abstract/id.rb, line 76
def []=(key, value)
  load_for_write!
  @data[key.to_s] = value
end
clear()
# File lib/rack/session/abstract/id.rb, line 82
def clear
  load_for_write!
  @data.clear
end
delete(key)
# File lib/rack/session/abstract/id.rb, line 108
def delete(key)
  load_for_write!
  @data.delete(key.to_s)
end
destroy()
# File lib/rack/session/abstract/id.rb, line 87
def destroy
  clear
  @id = @store.send(:delete_session, @req, id, options)
end
each(&block)
# File lib/rack/session/abstract/id.rb, line 50
def each(&block)
  load_for_read!
  @data.each(&block)
end
empty?()
# File lib/rack/session/abstract/id.rb, line 131
def empty?
  load_for_read!
  @data.empty?
end
exists?()
# File lib/rack/session/abstract/id.rb, line 121
def exists?
  return @exists if instance_variable_defined?(:@exists)
  @data = {}
  @exists = @store.send(:session_exists?, @req)
end
fetch(key, default=Unspecified, &block)
# File lib/rack/session/abstract/id.rb, line 60
def fetch(key, default=Unspecified, &block)
  load_for_read!
  if default == Unspecified
    @data.fetch(key.to_s, &block)
  else
    @data.fetch(key.to_s, default, &block)
  end
end
has_key?(key)
Also aliased as: key?, include?
# File lib/rack/session/abstract/id.rb, line 69
def has_key?(key)
  load_for_read!
  @data.has_key?(key.to_s)
end
id()
# File lib/rack/session/abstract/id.rb, line 41
def id
  return @id if @loaded or instance_variable_defined?(:@id)
  @id = @store.send(:extract_session_id, @req)
end
include?(key)
Alias for: has_key?
inspect()
# File lib/rack/session/abstract/id.rb, line 113
def inspect
  if loaded?
    @data.inspect
  else
    "#<#{self.class}:0x#{self.object_id.to_s(16)} not yet loaded>"
  end
end
key?(key)
Alias for: has_key?
keys()
# File lib/rack/session/abstract/id.rb, line 136
def keys
  load_for_read!
  @data.keys
end
loaded?()
# File lib/rack/session/abstract/id.rb, line 127
def loaded?
  @loaded
end
merge!(hash)
Alias for: update
options()
# File lib/rack/session/abstract/id.rb, line 46
def options
  @req.session_options
end
replace(hash)
# File lib/rack/session/abstract/id.rb, line 103
def replace(hash)
  load_for_write!
  @data.replace(stringify_keys(hash))
end
store(key, value)
Alias for: []=
to_hash()
# File lib/rack/session/abstract/id.rb, line 92
def to_hash
  load_for_read!
  @data.dup
end
update(hash)
Also aliased as: merge!
# File lib/rack/session/abstract/id.rb, line 97
def update(hash)
  load_for_write!
  @data.update(stringify_keys(hash))
end
values()
# File lib/rack/session/abstract/id.rb, line 141
def values
  load_for_read!
  @data.values
end