Class: ActionDispatch::MiddlewareStack::Middleware
Relationships & Source Files | |
Extension / Inclusion / Inheritance Descendants | |
Subclasses:
ActionController::MiddlewareStack::Middleware
|
|
Inherits: | Object |
Defined in: | actionpack/lib/action_dispatch/middleware/stack.rb |
Class Method Summary
- .new(klass_or_name, *args, &block) ⇒ Middleware constructor
Instance Attribute Summary
- #args readonly
- #block readonly
- #classcache readonly
- #name readonly
Instance Method Summary
Constructor Details
.new(klass_or_name, *args, &block) ⇒ Middleware
# File 'actionpack/lib/action_dispatch/middleware/stack.rb', line 9
def initialize(klass_or_name, *args, &block) @klass = nil if klass_or_name.respond_to?(:name) @klass = klass_or_name @name = @klass.name else @name = klass_or_name.to_s end @classcache = ActiveSupport::Dependencies::Reference @args, @block = args, block end
Instance Attribute Details
#args (readonly)
[ GitHub ]# File 'actionpack/lib/action_dispatch/middleware/stack.rb', line 7
attr_reader :args, :block, :name, :classcache
#block (readonly)
[ GitHub ]# File 'actionpack/lib/action_dispatch/middleware/stack.rb', line 7
attr_reader :args, :block, :name, :classcache
#classcache (readonly)
[ GitHub ]#name (readonly)
[ GitHub ]# File 'actionpack/lib/action_dispatch/middleware/stack.rb', line 7
attr_reader :args, :block, :name, :classcache
Instance Method Details
#==(middleware)
[ GitHub ]#build(app)
[ GitHub ]#inspect
[ GitHub ]# File 'actionpack/lib/action_dispatch/middleware/stack.rb', line 38
def inspect klass.to_s end
#klass
[ GitHub ]# File 'actionpack/lib/action_dispatch/middleware/stack.rb', line 23
def klass @klass || classcache[@name] end