Class: ActionDispatch::Cookies::PermanentCookieJar
- Inherits:
-
Object
- Object
- ActionDispatch::Cookies::PermanentCookieJar
- Includes:
- ChainedCookieJars
- Defined in:
- lib/action_dispatch/middleware/cookies.rb
Overview
:nodoc:
Instance Method Summary collapse
- #[](name) ⇒ Object
- #[]=(name, options) ⇒ Object
-
#initialize(parent_jar, key_generator, options = {}) ⇒ PermanentCookieJar
constructor
A new instance of PermanentCookieJar.
Methods included from ChainedCookieJars
#encrypted, #permanent, #signed, #signed_or_encrypted
Constructor Details
#initialize(parent_jar, key_generator, options = {}) ⇒ PermanentCookieJar
Returns a new instance of PermanentCookieJar.
366 367 368 369 370 |
# File 'lib/action_dispatch/middleware/cookies.rb', line 366 def initialize(parent_jar, key_generator, = {}) @parent_jar = parent_jar @key_generator = key_generator @options = end |
Instance Method Details
#[](name) ⇒ Object
372 373 374 |
# File 'lib/action_dispatch/middleware/cookies.rb', line 372 def [](name) @parent_jar[name.to_s] end |
#[]=(name, options) ⇒ Object
376 377 378 379 380 381 382 383 384 385 |
# File 'lib/action_dispatch/middleware/cookies.rb', line 376 def []=(name, ) if .is_a?(Hash) .symbolize_keys! else = { :value => } end [:expires] = 20.years.from_now @parent_jar[name] = end |