Class: Rack::Session::Abstract::OptionsHash

Inherits:
Hash
  • Object
show all
Defined in:
lib/rack/session/abstract/id.rb

Overview

Thin wrapper around Hash that allows us to lazily load session id into session_options.

Instance Method Summary collapse

Constructor Details

#initialize(by, env, default_options) ⇒ OptionsHash

:nodoc:



24
25
26
27
28
29
# File 'lib/rack/session/abstract/id.rb', line 24

def initialize(by, env, default_options)
  @by = by
  @env = env
  @session_id_loaded = false
  merge!(default_options)
end

Instance Method Details

#[](key) ⇒ Object



31
32
33
34
# File 'lib/rack/session/abstract/id.rb', line 31

def [](key)
  load_session_id! if key == :id && session_id_not_loaded?
  super
end