Class: Rack::Downtime::Strategy::Cookie

Inherits:
Object
  • Object
show all
Includes:
Utils
Defined in:
lib/rack/downtime/strategy.rb

Class Attribute Summary collapse

Instance Method Summary collapse

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

.namedObject



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.cookies[@named])
  #delete_cookie_header!(env, @named) if downtime
  #downtime
end