Class: Flame::Cookies
- Inherits:
-
Object
- Object
- Flame::Cookies
- Defined in:
- lib/flame/cookies.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.
4 5 6 7 |
# File 'lib/flame/cookies.rb', line 4 def initialize(, response) @request_cookies = @response = response end |
Instance Method Details
#[](key) ⇒ Object
9 10 11 |
# File 'lib/flame/cookies.rb', line 9 def [](key) @request_cookies[key.to_s] end |
#[]=(key, new_value) ⇒ Object
13 14 15 16 |
# File 'lib/flame/cookies.rb', line 13 def []=(key, new_value) return @response.(key.to_s, path: '/') if new_value.nil? @response.(key.to_s, value: new_value, path: '/') end |