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
- #id(req) ⇒ Object
-
#initialize(by, default_options) ⇒ Options
constructor
A new instance of Options.
- #to_hash ⇒ Object
- #values_at(*args) ⇒ Object
Constructor Details
#initialize(by, default_options) ⇒ Options
Returns a new instance of Options.
54 55 56 57 |
# File 'lib/action_dispatch/request/session.rb', line 54 def initialize(by, ) @by = by @delegate = .dup end |
Class Method Details
.find(req) ⇒ Object
50 51 52 |
# File 'lib/action_dispatch/request/session.rb', line 50 def self.find(req) req.get_header ENV_SESSION_OPTIONS_KEY end |
.set(req, options) ⇒ Object
46 47 48 |
# File 'lib/action_dispatch/request/session.rb', line 46 def self.set(req, ) req.set_header ENV_SESSION_OPTIONS_KEY, end |
Instance Method Details
#[](key) ⇒ Object
59 60 61 |
# File 'lib/action_dispatch/request/session.rb', line 59 def [](key) @delegate[key] end |
#[]=(k, v) ⇒ Object
69 |
# File 'lib/action_dispatch/request/session.rb', line 69 def []=(k, v); @delegate[k] = v; end |
#id(req) ⇒ Object
63 64 65 66 67 |
# File 'lib/action_dispatch/request/session.rb', line 63 def id(req) @delegate.fetch(:id) { @by.send(:extract_session_id, req) } end |
#to_hash ⇒ Object
70 |
# File 'lib/action_dispatch/request/session.rb', line 70 def to_hash; @delegate.dup; end |
#values_at(*args) ⇒ Object
71 |
# File 'lib/action_dispatch/request/session.rb', line 71 def values_at(*args); @delegate.values_at(*args); end |