lib/rest_service/api.rb
# Apply a custom middleware to the API. Applies
# to the current namespace and any children, but
# not parents.
#
# @param middleware_class [Class] The class of the middleware you'd like
#   to inject.
Apply a custom middleware to the API. Applies
to the current namespace and any children, but
not parents.
Apply a custom middleware to the API . Applies to the current namespace and any children but not parents .
def use(middleware_class, *args, &block)
        arr = [middleware_class, *args]
        arr << block if block_given?
        imbue(:middleware, [arr])
      end
def use ( middleware_class , * args , & block ) arr = [ middleware_class , * args ] arr << block if block_given? imbue ( :middleware , [ arr ] ) end
Apply a custom middleware to the API.
Apply a custom middleware to the API .
middleware_class
The class of the middleware you'd like to inject.
The class of the middleware you ' d like to inject .
args
block