Sha256: ae2c917dd4d1f07938922c9cd8d82c3d31e1f84d5a96713492177789c09f86fe

Contents?: true

Size: 498 Bytes

Versions: 28

Compression:

Stored size: 498 Bytes

Contents

module Rack::App::SingletonMethods::Middleware

  def middlewares(&block)
    @middlewares ||= []
    unless block.nil?
      @middlewares << block
      router.reset
    end
    @middlewares
  end

  alias middleware middlewares

  def use(*args, &block)
    middlewares{ |b| b.use(*args, &block) }
  end

  protected

  def next_endpoint_middlewares(&block)
    @next_endpoint_middlewares ||= []
    @next_endpoint_middlewares << block unless block.nil?
    @next_endpoint_middlewares
  end

end

Version data entries

28 entries across 28 versions & 2 rubygems

Version Path
rack-app-11.0.2 lib/rack/app/singleton_methods/middleware.rb
rack-app-11.0.1 lib/rack/app/singleton_methods/middleware.rb
rack-app-11.0.0 lib/rack/app/singleton_methods/middleware.rb
rack-app-10.0.0 lib/rack/app/singleton_methods/middleware.rb
rack-app-9.0.0 lib/rack/app/singleton_methods/middleware.rb
rack-app-8.1.0 lib/rack/app/singleton_methods/middleware.rb
rack-app-8.0.1 lib/rack/app/singleton_methods/middleware.rb
rack-app-8.0.0 lib/rack/app/singleton_methods/middleware.rb
mountapi-0.11.1 vendor/bundle/ruby/2.7.0/gems/rack-app-7.7.0/lib/rack/app/singleton_methods/middleware.rb
rack-app-7.7.0 lib/rack/app/singleton_methods/middleware.rb
rack-app-7.6.5 lib/rack/app/singleton_methods/middleware.rb
rack-app-7.6.4 lib/rack/app/singleton_methods/middleware.rb
rack-app-7.6.3 lib/rack/app/singleton_methods/middleware.rb
rack-app-7.6.2 lib/rack/app/singleton_methods/middleware.rb
rack-app-7.6.1 lib/rack/app/singleton_methods/middleware.rb
rack-app-7.6.0 lib/rack/app/singleton_methods/middleware.rb
rack-app-7.5.2 lib/rack/app/singleton_methods/middleware.rb
rack-app-7.5.1 lib/rack/app/singleton_methods/middleware.rb
rack-app-7.5.0 lib/rack/app/singleton_methods/middleware.rb
rack-app-7.4.0 lib/rack/app/singleton_methods/middleware.rb