Class: ActionDispatch::Cookies::PermanentCookieJar
Overview
:nodoc:
Constant Summary
Constant Summary
Constants inherited from CookieJar
Instance Method Summary (collapse)
- - (Object) []=(key, options)
-
- (PermanentCookieJar) initialize(parent_jar, secret)
constructor
A new instance of PermanentCookieJar.
- - (Object) method_missing(method, *arguments, &block)
- - (Object) signed
Methods inherited from CookieJar
#[], build, #clear, #delete, #each, #handle_options, #key?, #permanent, #recycle!, #update, #write
Methods included from Enumerable
#as_json, #each_with_object, #exclude?, #group_by, #index_by, #many?, #sum
Constructor Details
- (PermanentCookieJar) initialize(parent_jar, secret)
A new instance of PermanentCookieJar
253 254 255 |
# File 'actionpack/lib/action_dispatch/middleware/cookies.rb', line 253 def initialize(parent_jar, secret) @parent_jar, @secret = parent_jar, secret end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
- (Object) method_missing(method, *arguments, &block)
272 273 274 |
# File 'actionpack/lib/action_dispatch/middleware/cookies.rb', line 272 def method_missing(method, *arguments, &block) @parent_jar.send(method, *arguments, &block) end |
Instance Method Details
- (Object) []=(key, options)
257 258 259 260 261 262 263 264 265 266 |
# File 'actionpack/lib/action_dispatch/middleware/cookies.rb', line 257 def []=(key, ) if .is_a?(Hash) .symbolize_keys! else = { :value => } end [:expires] = 20.years.from_now @parent_jar[key] = end |
- (Object) signed
268 269 270 |
# File 'actionpack/lib/action_dispatch/middleware/cookies.rb', line 268 def signed @signed ||= SignedCookieJar.new(self, @secret) end |