Class: Lookout::Rack::Cookies
- Inherits:
-
Object
- Object
- Lookout::Rack::Cookies
- Defined in:
- lib/lookout-rack-1.0/cookies.rb
Instance Method Summary collapse
- #for(uri) ⇒ Object
-
#initialize(default_host = Lookout::Rack::DefaultHost) ⇒ Cookies
constructor
A new instance of Cookies.
- #merge!(headers, uri = nil) ⇒ Object
Constructor Details
#initialize(default_host = Lookout::Rack::DefaultHost) ⇒ Cookies
Returns a new instance of Cookies.
4 5 6 7 |
# File 'lib/lookout-rack-1.0/cookies.rb', line 4 def initialize(default_host = Lookout::Rack::DefaultHost) @default_host = default_host @cookies = {} end |
Instance Method Details
#for(uri) ⇒ Object
17 18 19 20 |
# File 'lib/lookout-rack-1.0/cookies.rb', line 17 def for(uri) @cookies.values.select{ |c| c.matches? uri }.sort. reduce({}){ |h, c| h[c.name] = c; h }.values.join(';') end |