lib/grape/middleware_stack.rb
# Add a new middleware to the stack. Syntax
# is identical to normal middleware <tt>#use</tt>
# functionality.
#
# @param [Class] klass The middleware class.
Add a new middleware to the stack. Syntax
is identical to normal middleware #use
functionality.
Add a new middleware to the stack . Syntax is identical to normal middleware #use functionality .
def use(klass, *args)
      if index = @stack.index(@stack.find{|a| a.first == klass})
        @stack[index] = [klass, *args]
      else
        @stack << [klass, *args]
      end
    end
def use ( klass , * args ) if index = @stack . index ( @stack . find { | a | a . first == klass } ) @stack [ index ] = [ klass , * args ] else @stack << [ klass , * args ] end end
Add a new middleware to the stack.
Add a new middleware to the stack .
klass
<not_specific>
args
<not_specific>
<not_specific>
klass The middleware class.
klass The middleware class .