Flowdock
method

build_middleware

Importance_0
v5.0.0.1 - Show latest stable - 0 notes - Class: ActionController::MiddlewareStack
build_middleware(klass, args, block) private

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

Hide source
# File actionpack/lib/action_controller/metal.rb, line 41
    def build_middleware(klass, args, block)
      options = args.extract_options!
      only   = Array(options.delete(:only)).map(&:to_s)
      except = Array(options.delete(:except)).map(&:to_s)
      args << options unless options.empty?

      strategy = NULL
      list     = nil

      if only.any?
        strategy = INCLUDE
        list     = only
      elsif except.any?
        strategy = EXCLUDE
        list     = except
      end

      Middleware.new(get_class(klass), args, list, strategy, block)
    end
Register or log in to add new notes.