Class: WebTrap::Shared::RackApp Private
- Inherits:
-
Object
- Object
- WebTrap::Shared::RackApp
- Defined in:
- lib/webtrap/shared/rack_app.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Rack applications used to intercept HTTP requests and apply a set of validators on them.
Instance Method Summary collapse
-
#call(request) ⇒ Array<Fixnum, Hash, Array>
private
Handle an HTTP request.
-
#initialize(validators) ⇒ RackApp
constructor
private
Instantiate a new Rack application with the provided set of validators.
Constructor Details
#initialize(validators) ⇒ RackApp
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Instantiate a new Rack application with the provided set of validators.
15 16 17 |
# File 'lib/webtrap/shared/rack_app.rb', line 15 def initialize(validators) @validators = validators end |
Instance Method Details
#call(request) ⇒ Array<Fixnum, Hash, Array>
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Handle an HTTP request.
27 28 29 30 31 32 |
# File 'lib/webtrap/shared/rack_app.rb', line 27 def call(request) @validators.find do |v| v.validate(request).failed? end [200, {}, []] end |