Class: Rack::Head
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app) ⇒ Head
constructor
A new instance of Head.
Constructor Details
#initialize(app) ⇒ Head
Returns a new instance of Head.
4 5 6 |
# File 'lib/gems/rack-0.9.1/lib/rack/head.rb', line 4 def initialize(app) @app = app end |
Instance Method Details
#call(env) ⇒ Object
8 9 10 11 12 13 14 15 16 |
# File 'lib/gems/rack-0.9.1/lib/rack/head.rb', line 8 def call(env) status, headers, body = @app.call(env) if env["REQUEST_METHOD"] == "HEAD" [status, headers, []] else [status, headers, body] end end |