Class: ClientSideValidations::Middleware::Validators
- Inherits:
-
Object
- Object
- ClientSideValidations::Middleware::Validators
- Defined in:
- lib/client_side_validations/middleware.rb
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app) ⇒ Validators
constructor
A new instance of Validators.
Constructor Details
#initialize(app) ⇒ Validators
Returns a new instance of Validators.
8 9 10 |
# File 'lib/client_side_validations/middleware.rb', line 8 def initialize(app) @app = app end |
Instance Method Details
#call(env) ⇒ Object
12 13 14 15 16 17 18 19 |
# File 'lib/client_side_validations/middleware.rb', line 12 def call(env) case env['PATH_INFO'] when %r{\/validators\/(\w+)\.json} "::ClientSideValidations::Middleware::#{$1.camelize}".constantize.new(env).response else @app.call(env) end end |