Class: Rack::Status

Inherits:
Object
  • Object
show all
Defined in:
lib/rack/status.rb,
lib/rack/status/version.rb

Constant Summary collapse

VERSION =
"1.0.0"

Instance Method Summary collapse

Constructor Details

#initialize(app) ⇒ Status

Returns a new instance of Status.



5
6
7
# File 'lib/rack/status.rb', line 5

def initialize(app)
  @app = app
end

Instance Method Details

#call(env) ⇒ Object



9
10
11
12
13
14
15
# File 'lib/rack/status.rb', line 9

def call(env)
  if env["PATH_INFO"] == "/status"
    [200, { "Content-Type" => "text/plain" }, ["OK"]]
  else
    @app.call(env)
  end
end