edge badge
Namespace
Methods
#
B
D
E
I
L
N
S
U
Included Modules
Attributes
[RW] middlewares
Class Public methods
new(*args)
# File actionpack/lib/action_dispatch/middleware/stack.rb, line 30
def initialize(*args)
  @middlewares = []
  yield(self) if block_given?
end
Instance Public methods
[](i)
# File actionpack/lib/action_dispatch/middleware/stack.rb, line 47
def [](i)
  middlewares[i]
end
build(app = Proc.new)
# File actionpack/lib/action_dispatch/middleware/stack.rb, line 86
def build(app = Proc.new)
  middlewares.freeze.reverse.inject(app) { |a, e| e.build(a) }
end
delete(target)
# File actionpack/lib/action_dispatch/middleware/stack.rb, line 77
def delete(target)
  target = get_class target
  middlewares.delete_if { |m| m.klass == target }
end
each()
# File actionpack/lib/action_dispatch/middleware/stack.rb, line 35
def each
  @middlewares.each { |x| yield x }
end
initialize_copy(other)
# File actionpack/lib/action_dispatch/middleware/stack.rb, line 55
def initialize_copy(other)
  self.middlewares = other.middlewares.dup
end
insert(index, klass, *args, &block)
Also aliased as: insert_before
# File actionpack/lib/action_dispatch/middleware/stack.rb, line 59
def insert(index, klass, *args, &block)
  index = assert_index(index, :before)
  middlewares.insert(index, build_middleware(klass, args, block))
end
insert_after(index, *args, &block)
# File actionpack/lib/action_dispatch/middleware/stack.rb, line 66
def insert_after(index, *args, &block)
  index = assert_index(index, :after)
  insert(index + 1, *args, &block)
end
insert_before(index, klass, *args, &block)
Alias for: insert
last()
# File actionpack/lib/action_dispatch/middleware/stack.rb, line 43
def last
  middlewares.last
end
size()
# File actionpack/lib/action_dispatch/middleware/stack.rb, line 39
def size
  middlewares.size
end
swap(target, *args, &block)
# File actionpack/lib/action_dispatch/middleware/stack.rb, line 71
def swap(target, *args, &block)
  index = assert_index(target, :before)
  insert(index, *args, &block)
  middlewares.delete_at(index + 1)
end
unshift(klass, *args, &block)
# File actionpack/lib/action_dispatch/middleware/stack.rb, line 51
def unshift(klass, *args, &block)
  middlewares.unshift(build_middleware(klass, args, block))
end
use(klass, *args, &block)
# File actionpack/lib/action_dispatch/middleware/stack.rb, line 82
def use(klass, *args, &block)
  middlewares.push(build_middleware(klass, args, block))
end