Class: Rack::Downtime::Strategy::Env
- Inherits:
-
Object
- Object
- Rack::Downtime::Strategy::Env
- Defined in:
- lib/rack/downtime/strategy.rb
Direct Known Subclasses
Class Attribute Summary collapse
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(named = nil) ⇒ Env
constructor
A new instance of Env.
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
.named ⇒ Object
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 |