Sha256: 9cf4cf275649eb7653c015cfec74887c0e72d4f20bee9a8f09543a5d878b59d7

Contents?: true

Size: 682 Bytes

Versions: 2

Compression:

Stored size: 682 Bytes

Contents

module ActionController
  class Middleware < Metal
    class ActionMiddleware
      def initialize(controller, app)
        @controller, @app = controller, app
      end

      def call(env)
        @controller.build(@app).dispatch(:index, env)
      end
    end

    class << self
      alias build new

      def new(app)
        ActionMiddleware.new(self, app)
      end
    end

    attr_internal :app

    def process(action)
      response = super
      self.status, self.headers, self.response_body = response if response.is_a?(Array)
      response
    end

    def initialize(app)
      super()
      @_app = app
    end
    
    def index
      call(env)
    end
  end
end

Version data entries

2 entries across 2 versions & 2 rubygems

Version Path
actionpack-3.0.0.beta lib/action_controller/middleware.rb
halorgium-actionpack-3.0.pre lib/action_controller/middleware.rb