Class: Rack::Downtime::Strategy::Cookie
- Inherits:
-
Object
- Object
- Rack::Downtime::Strategy::Cookie
- Includes:
- Utils
- Defined in:
- lib/rack/downtime/strategy.rb
Class Attribute Summary collapse
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(named = nil) ⇒ Cookie
constructor
A new instance of Cookie.
Constructor Details
#initialize(named = nil) ⇒ Cookie
Returns a new instance of Cookie.
18 19 20 |
# File 'lib/rack/downtime/strategy.rb', line 18 def initialize(named = nil) @named = named || self.class.named end |
Class Attribute Details
.named ⇒ Object
13 14 15 |
# File 'lib/rack/downtime/strategy.rb', line 13 def named @named ||= "__dt__" end |
Instance Method Details
#call(env) ⇒ Object
22 23 24 25 26 27 |
# File 'lib/rack/downtime/strategy.rb', line 22 def call(env) req = Rack::Request.new(env) Rack::Downtime::Utils.parse_downtime(req.[@named]) #delete_cookie_header!(env, @named) if downtime #downtime end |