Class: Rack::Validator
- Inherits:
-
Object
- Object
- Rack::Validator
- Defined in:
- lib/rack/validator.rb
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app) ⇒ Validator
constructor
A new instance of Validator.
Constructor Details
#initialize(app) ⇒ Validator
Returns a new instance of Validator.
6 7 8 |
# File 'lib/rack/validator.rb', line 6 def initialize(app) @app = app end |
Instance Method Details
#call(env) ⇒ Object
10 11 12 13 14 15 |
# File 'lib/rack/validator.rb', line 10 def call(env) status, headers, response = @app.call(env) @response = response.respond_to?(:body) ? Rack::TidyResponse.new(response.body).to_s : response [status, headers, @response] end |