Class: ActionDispatch::Request::Session::Options
- Inherits:
-
Object
- Object
- ActionDispatch::Request::Session::Options
- Defined in:
- 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.
40 41 42 43 44 |
# File 'lib/action_dispatch/request/session.rb', line 40 def initialize(by, env, ) @by = by @env = env @delegate = .dup end |
Class Method Details
.find(env) ⇒ Object
36 37 38 |
# File 'lib/action_dispatch/request/session.rb', line 36 def self.find(env) env[ENV_SESSION_OPTIONS_KEY] end |
.set(env, options) ⇒ Object
32 33 34 |
# File 'lib/action_dispatch/request/session.rb', line 32 def self.set(env, ) env[ENV_SESSION_OPTIONS_KEY] = end |
Instance Method Details
#[](key) ⇒ Object
46 47 48 49 50 51 52 53 54 |
# File 'lib/action_dispatch/request/session.rb', line 46 def [](key) if key == :id @delegate.fetch(key) { @delegate[:id] = @by.send(:extract_session_id, @env) } else @delegate[key] end end |
#[]=(k, v) ⇒ Object
56 |
# File 'lib/action_dispatch/request/session.rb', line 56 def []=(k,v); @delegate[k] = v; end |
#to_hash ⇒ Object
57 |
# File 'lib/action_dispatch/request/session.rb', line 57 def to_hash; @delegate.dup; end |
#values_at(*args) ⇒ Object
58 |
# File 'lib/action_dispatch/request/session.rb', line 58 def values_at(*args); @delegate.values_at(*args); end |