Class: ActionController::Session::AbstractStore::SessionHash
- Defined in:
- lib/action_controller/session/abstract_store.rb
Instance Method Summary collapse
- #[](key) ⇒ Object
- #[]=(key, value) ⇒ Object
- #data ⇒ Object
-
#initialize(by, env) ⇒ SessionHash
constructor
A new instance of SessionHash.
- #inspect ⇒ Object
- #session_id ⇒ Object
- #to_hash ⇒ Object
Constructor Details
#initialize(by, env) ⇒ SessionHash
Returns a new instance of SessionHash.
13 14 15 16 17 18 |
# File 'lib/action_controller/session/abstract_store.rb', line 13 def initialize(by, env) super() @by = by @env = env @loaded = false end |
Instance Method Details
#[](key) ⇒ Object
27 28 29 30 |
# File 'lib/action_controller/session/abstract_store.rb', line 27 def [](key) load! unless @loaded super end |
#[]=(key, value) ⇒ Object
32 33 34 35 |
# File 'lib/action_controller/session/abstract_store.rb', line 32 def []=(key, value) load! unless @loaded super end |
#data ⇒ Object
43 44 45 46 47 48 |
# File 'lib/action_controller/session/abstract_store.rb', line 43 def data ActiveSupport::Deprecation.warn( "ActionController::Session::AbstractStore::SessionHash#data " + "has been deprecated. Please use #to_hash instead.", caller) to_hash end |
#inspect ⇒ Object
50 51 52 53 |
# File 'lib/action_controller/session/abstract_store.rb', line 50 def inspect load! unless @loaded super end |
#session_id ⇒ Object
20 21 22 23 24 25 |
# File 'lib/action_controller/session/abstract_store.rb', line 20 def session_id ActiveSupport::Deprecation.warn( "ActionController::Session::AbstractStore::SessionHash#session_id " + "has been deprecated. Please use request.session_options[:id] instead.", caller) @env[ENV_SESSION_OPTIONS_KEY][:id] end |
#to_hash ⇒ Object
37 38 39 40 41 |
# File 'lib/action_controller/session/abstract_store.rb', line 37 def to_hash h = {}.replace(self) h.delete_if { |k,v| v.nil? } h end |