Class: Rack::Downtime::Strategy::Query

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

Class Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(param = nil) ⇒ Query

Returns a new instance of Query.



68
69
70
# File 'lib/rack/downtime/strategy.rb', line 68

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

Class Attribute Details

.paramObject



63
64
65
# File 'lib/rack/downtime/strategy.rb', line 63

def param
  @param ||= "__dt__"
end

Instance Method Details

#call(env) ⇒ Object



72
73
74
75
# File 'lib/rack/downtime/strategy.rb', line 72

def call(env)
  req = Rack::Request.new(env)
  Rack::Downtime::Utils.parse_downtime(req[@param])
end