Class: ActionDispatch::Request::Session::Options
- Defined in:
- actionpack/lib/action_dispatch/request/session.rb
Overview
:nodoc:
Class Method Summary collapse
Instance Method Summary collapse
- #[](key) ⇒ Object
- #[]=(k, v) ⇒ Object
-
#initialize(by, env, default_options) ⇒ Options
constructor
A new instance of Options.
- #to_hash ⇒ Object
- #values_at(*args) ⇒ Object
Constructor Details
#initialize(by, env, default_options) ⇒ Options
Returns a new instance of Options.
37 38 39 40 41 |
# File 'actionpack/lib/action_dispatch/request/session.rb', line 37 def initialize(by, env, ) @by = by @env = env @delegate = .dup end |
Class Method Details
.find(env) ⇒ Object
33 34 35 |
# File 'actionpack/lib/action_dispatch/request/session.rb', line 33 def self.find(env) env[ENV_SESSION_OPTIONS_KEY] end |
.set(env, options) ⇒ Object
29 30 31 |
# File 'actionpack/lib/action_dispatch/request/session.rb', line 29 def self.set(env, ) env[ENV_SESSION_OPTIONS_KEY] = end |
Instance Method Details
#[](key) ⇒ Object
43 44 45 46 47 48 49 50 51 |
# File 'actionpack/lib/action_dispatch/request/session.rb', line 43 def [](key) if key == :id @delegate.fetch(key) { @delegate[:id] = @by.send(:extract_session_id, @env) } else @delegate[key] end end |
#[]=(k, v) ⇒ Object
53 |
# File 'actionpack/lib/action_dispatch/request/session.rb', line 53 def []=(k,v); @delegate[k] = v; end |
#to_hash ⇒ Object
54 |
# File 'actionpack/lib/action_dispatch/request/session.rb', line 54 def to_hash; @delegate.dup; end |
#values_at(*args) ⇒ Object
55 |
# File 'actionpack/lib/action_dispatch/request/session.rb', line 55 def values_at(*args); @delegate.values_at(*args); end |