123456789_123456789_123456789_123456789_123456789_

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

Instance Attribute Summary

Instance Method Summary

Constructor Details

.new(klass, args, block) ⇒ Middleware

[ GitHub ]

  
# File 'actionpack/lib/action_dispatch/middleware/stack.rb', line 11

def initialize(klass, args, block)
  @klass = klass
  @args  = args
  @block = block
end

Instance Attribute Details

#args (readonly)

[ GitHub ]

  
# File 'actionpack/lib/action_dispatch/middleware/stack.rb', line 9

attr_reader :args, :block, :klass

#block (readonly)

[ GitHub ]

  
# File 'actionpack/lib/action_dispatch/middleware/stack.rb', line 9

attr_reader :args, :block, :klass

#klass (readonly)

[ GitHub ]

  
# File 'actionpack/lib/action_dispatch/middleware/stack.rb', line 9

attr_reader :args, :block, :klass

Instance Method Details

#==(middleware)

[ GitHub ]

  
# File 'actionpack/lib/action_dispatch/middleware/stack.rb', line 19

def ==(middleware)
  case middleware
  when Middleware
    klass == middleware.klass
  when Class
    klass == middleware
  end
end

#build(app)

[ GitHub ]

  
# File 'actionpack/lib/action_dispatch/middleware/stack.rb', line 36

def build(app)
  klass.new(app, *args, &block)
end

#inspect

[ GitHub ]

  
# File 'actionpack/lib/action_dispatch/middleware/stack.rb', line 28

def inspect
  if klass.is_a?(Class)
    klass.to_s
  else
    klass.class.to_s
  end
end

#name

[ GitHub ]

  
# File 'actionpack/lib/action_dispatch/middleware/stack.rb', line 17

def name; klass.name; end