Class: Rack::Downtime::Strategy::Env

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

Direct Known Subclasses

Header

Class Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(named = nil) ⇒ Env

Returns a new instance of Env.



39
40
41
# File 'lib/rack/downtime/strategy.rb', line 39

def initialize(named = nil)
  @named = named || self.class.named
end

Class Attribute Details

.namedObject



34
35
36
# File 'lib/rack/downtime/strategy.rb', line 34

def named
  @named ||= "RACK_DOWNTIME"
end

Instance Method Details

#call(env) ⇒ Object



43
44
45
# File 'lib/rack/downtime/strategy.rb', line 43

def call(env)
  Rack::Downtime::Utils.parse_downtime(env[@named])
end