Class: Rack::HTTPCat
- Inherits:
-
Object
- Object
- Rack::HTTPCat
- Defined in:
- lib/rack/http_cat.rb
Constant Summary collapse
- VERSION =
"1.0.0"
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app) ⇒ HTTPCat
constructor
A new instance of HTTPCat.
Constructor Details
#initialize(app) ⇒ HTTPCat
Returns a new instance of HTTPCat.
6 7 8 |
# File 'lib/rack/http_cat.rb', line 6 def initialize(app) @app = app end |
Instance Method Details
#call(env) ⇒ Object
10 11 12 13 14 |
# File 'lib/rack/http_cat.rb', line 10 def call(env) status, headers, response = @app.call(env) headers["HTTP-Cat"] = "https://http.cat/#{status}" [status, headers, response] end |