class Grape::Middleware::Stack::Middleware
Attributes
Public Class Methods
Source
# File lib/grape/middleware/stack.rb, line 12 def initialize(klass, args, block) @klass = klass @args = args @block = block end
Public Instance Methods
Source
# File lib/grape/middleware/stack.rb, line 22 def ==(other) case other when Middleware klass == other.klass when Class klass == other || (name.nil? && klass.superclass == other) end end
Source
# File lib/grape/middleware/stack.rb, line 35 def build(builder) # we need to force the ruby2_keywords_hash for middlewares that initialize contains keywords # like ActionDispatch::RequestId since middleware arguments are serialized # https://rubyapi.org/3.4/o/hash#method-c-ruby2_keywords_hash args[-1] = Hash.ruby2_keywords_hash(args[-1]) if args.last.is_a?(Hash) && Hash.respond_to?(:ruby2_keywords_hash) builder.use(klass, *args, &block) end