Class: ActionController::Session::AbstractStore::OptionsHash

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



15
16
17
18
19
20
# File 'lib/action_controller/session/abstract_store.rb', line 15

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

Instance Method Details

#[](key) ⇒ Object



22
23
24
25
26
27
# File 'lib/action_controller/session/abstract_store.rb', line 22

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