Class: ActionDispatch::Cookies::AbstractCookieJar
- Inherits:
-
Object
- Object
- ActionDispatch::Cookies::AbstractCookieJar
- Includes:
- ChainedCookieJars
- Defined in:
- lib/action_dispatch/middleware/cookies.rb
Overview
:nodoc:
Direct Known Subclasses
Instance Method Summary collapse
- #[](name) ⇒ Object
- #[]=(name, options) ⇒ Object
-
#initialize(parent_jar) ⇒ AbstractCookieJar
constructor
A new instance of AbstractCookieJar.
Methods included from ChainedCookieJars
#encrypted, #permanent, #signed, #signed_or_encrypted
Constructor Details
#initialize(parent_jar) ⇒ AbstractCookieJar
Returns a new instance of AbstractCookieJar.
448 449 450 |
# File 'lib/action_dispatch/middleware/cookies.rb', line 448 def initialize(parent_jar) @parent_jar = parent_jar end |
Instance Method Details
#[](name) ⇒ Object
452 453 454 455 456 |
# File 'lib/action_dispatch/middleware/cookies.rb', line 452 def [](name) if data = @parent_jar[name.to_s] parse name, data end end |
#[]=(name, options) ⇒ Object
458 459 460 461 462 463 464 465 466 467 |
# File 'lib/action_dispatch/middleware/cookies.rb', line 458 def []=(name, ) if .is_a?(Hash) .symbolize_keys! else = { value: } end commit() @parent_jar[name] = end |