Class: Rails::Configuration::MiddlewareStackProxy
- Inherits:
-
Object
- Object
- Rails::Configuration::MiddlewareStackProxy
- Includes:
- Enumerable
- Defined in:
- lib/panda/core/middleware.rb
Overview
Add a tiny compatibility layer so the proxy can be inspected and reset in tests.
Defined Under Namespace
Classes: MiddlewareEntry
Instance Method Summary collapse
- #[](index) ⇒ Object
- #clear ⇒ Object
- #each(&block) ⇒ Object
- #first ⇒ Object
- #last ⇒ Object
- #size ⇒ Object
- #to_a ⇒ Object
Instance Method Details
#[](index) ⇒ Object
25 26 27 |
# File 'lib/panda/core/middleware.rb', line 25 def [](index) to_a[index] end |
#clear ⇒ Object
11 12 13 14 15 |
# File 'lib/panda/core/middleware.rb', line 11 def clear operations.clear delete_operations.clear self end |
#each(&block) ⇒ Object
17 18 19 |
# File 'lib/panda/core/middleware.rb', line 17 def each(&block) to_stack.each { |mw| block.call(wrap_middleware(mw)) } end |
#first ⇒ Object
29 30 31 |
# File 'lib/panda/core/middleware.rb', line 29 def first to_a.first end |
#last ⇒ Object
33 34 35 |
# File 'lib/panda/core/middleware.rb', line 33 def last to_a.last end |
#size ⇒ Object
37 38 39 |
# File 'lib/panda/core/middleware.rb', line 37 def size to_a.size end |
#to_a ⇒ Object
21 22 23 |
# File 'lib/panda/core/middleware.rb', line 21 def to_a map(&:itself) end |