123456789_123456789_123456789_123456789_123456789_

Class: Rack::Lint

Relationships & Source Files
Namespace Children
Classes:
Exceptions:
Inherits: Object
Defined in: lib/rack/lint.rb

Overview

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

Class Method Summary

Instance Method Summary

  • #call(env = nil) Internal use only

    AUTHORS: n.b. The trailing whitespace between paragraphs is important and should not be removed.

Constructor Details

.new(app) ⇒ Lint

[ GitHub ]

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

def initialize(app)
  @app = app
end

Instance Method Details

#call(env = nil)

This method is for internal use only.

AUTHORS: n.b. The trailing whitespace between paragraphs is important and should not be removed. The whitespace creates paragraphs in the RDoc output.

This specification aims to formalize the ::Rack protocol. You can (and should) use 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.

[ GitHub ]

  
# File 'lib/rack/lint.rb', line 34

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