Module: OpenapiFirst::UseRouter
- Included in:
- RequestValidation, ResponseValidation
- Defined in:
- lib/openapi_first/use_router.rb
Instance Method Summary collapse
Instance Method Details
#call(env) ⇒ Object
11 12 13 14 15 16 17 18 |
# File 'lib/openapi_first/use_router.rb', line 11 def call(env) return super if env.key?(OPERATION) @router ||= Router.new(lambda { |e| super(e) }, spec: .fetch(:spec), raise_error: .fetch(:raise_error, false)) @router.call(env) end |
#initialize(app, options = {}) ⇒ Object
5 6 7 8 9 |
# File 'lib/openapi_first/use_router.rb', line 5 def initialize(app, = {}) @app = app = super end |