Class: ActionDispatch::Session::AbstractStore::OptionsHash

Inherits:
Hash
  • Object
show all
Defined in:
lib/action_dispatch/middleware/session/abstract_store.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

Returns a new instance of OptionsHash.



18
19
20
21
22
23
# File 'lib/action_dispatch/middleware/session/abstract_store.rb', line 18

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

Instance Method Details

#[](key) ⇒ Object



25
26
27
28
29
30
# File 'lib/action_dispatch/middleware/session/abstract_store.rb', line 25

def [](key)
  if key == :id
    load_session_id! unless key?(:id) || has_session_id?
  end
  super
end