Method: Hanami::API::Middleware::Stack#use

Defined in:
lib/hanami/api/middleware.rb

#use(path, middleware, *args, &blk) ⇒ Object

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.

Since:

  • 0.1.0



26
27
28
29
30
# File 'lib/hanami/api/middleware.rb', line 26

def use(path, middleware, *args, &blk)
  # FIXME: test with prefix when Hanami::API.settings and prefix will be supported
  @stack[path] ||= []
  @stack[path].push([middleware, args, blk])
end