Sha256: caaad1e5404805c40accf1baebdeb67b7d955fdb107c1111c37e8d1cdbe9b0fb

Contents?: true

Size: 668 Bytes

Versions: 12

Compression:

Stored size: 668 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)
    middlewares{ |b| b.use(*args) }
  end

  protected

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

  alias only_next_endpoint_middlewares next_endpoint_middlewares

  Rack::App::Utils.deprecate(self,
    :only_next_endpoint_middlewares,
    :next_endpoint_middlewares,
    2016,9
  )

end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
rack-app-5.10.1 lib/rack/app/singleton_methods/middleware.rb
rack-app-5.10.0 lib/rack/app/singleton_methods/middleware.rb
rack-app-5.9.0 lib/rack/app/singleton_methods/middleware.rb
rack-app-5.8.0 lib/rack/app/singleton_methods/middleware.rb
rack-app-5.7.0 lib/rack/app/singleton_methods/middleware.rb
rack-app-5.7.0.rc lib/rack/app/singleton_methods/middleware.rb
rack-app-5.6.0 lib/rack/app/singleton_methods/middleware.rb
rack-app-5.5.1 lib/rack/app/singleton_methods/middleware.rb
rack-app-5.4.0 lib/rack/app/singleton_methods/middleware.rb
rack-app-5.3.2 lib/rack/app/singleton_methods/middleware.rb
rack-app-5.3.1 lib/rack/app/singleton_methods/middleware.rb
rack-app-5.3.0 lib/rack/app/singleton_methods/middleware.rb