Class: Mach::Rack::RequestValidator
- Inherits:
-
Object
- Object
- Mach::Rack::RequestValidator
- Defined in:
- lib/mach/rack/request_validator.rb
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app) ⇒ RequestValidator
constructor
A new instance of RequestValidator.
Constructor Details
#initialize(app) ⇒ RequestValidator
Returns a new instance of RequestValidator.
4 5 6 |
# File 'lib/mach/rack/request_validator.rb', line 4 def initialize app @app = app end |
Instance Method Details
#call(env) ⇒ Object
8 9 10 11 12 13 14 15 |
# File 'lib/mach/rack/request_validator.rb', line 8 def call env request = Mach::Request.new(env) if request. && !Mach::RequestValidator.valid?(request) failure else success(env) end end |