Class: Flame::Dispatcher::Cookies
- Inherits:
-
Object
- Object
- Flame::Dispatcher::Cookies
- Defined in:
- lib/flame/dispatcher.rb
Overview
Helper class for cookies
Instance Method Summary collapse
- #[](key) ⇒ Object
- #[]=(key, new_value) ⇒ Object
-
#initialize(request_cookies, response) ⇒ Cookies
constructor
A new instance of Cookies.
Constructor Details
#initialize(request_cookies, response) ⇒ Cookies
Returns a new instance of Cookies.
132 133 134 135 |
# File 'lib/flame/dispatcher.rb', line 132 def initialize(, response) @request_cookies = @response = response end |
Instance Method Details
#[](key) ⇒ Object
137 138 139 |
# File 'lib/flame/dispatcher.rb', line 137 def [](key) @request_cookies[key.to_s] end |
#[]=(key, new_value) ⇒ Object
141 142 143 144 |
# File 'lib/flame/dispatcher.rb', line 141 def []=(key, new_value) return @response.(key.to_s, path: '/') if new_value.nil? @response.(key.to_s, value: new_value, path: '/') end |