Class: Rack::Lint

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

Overview

Rack::Lint validates your application and the requests and responses according to the Rack spec.

Defined Under Namespace

Classes: LintError, Wrapper

Instance Method Summary collapse

Constructor Details

#initialize(app) ⇒ Lint

Returns a new instance of Lint.


13
14
15
# File 'lib/rack/lint.rb', line 13

def initialize(app)
  @app = app
end

Instance Method Details

#call(env = nil) ⇒ Object

This specification aims to formalize the Rack protocol. You can (and should) use Rack::Lint to enforce it.

When you develop middleware, be sure to add a Lint before and after to catch all mistakes.

Rack applications

A Rack application is a Ruby object (not a class) that responds to call.


31
32
33
# File 'lib/rack/lint.rb', line 31

def call(env = nil)
  Wrapper.new(@app, env).response
end