Method: Grape::Middleware::Stack#concat

Defined in:
lib/grape/middleware/stack.rb

#concat(other_specs) ⇒ Object

Parameters:

  • other_specs (Array)

    An array of middleware specifications (e.g. [[:use, klass], [:insert_before, *args]])



97
98
99
100
# File 'lib/grape/middleware/stack.rb', line 97

def concat(other_specs)
  @others << Array(other_specs).reject { |o| o.first == :use }
  merge_with Array(other_specs).select { |o| o.first == :use }
end