Class: Brute::Middleware::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/brute/middleware/base.rb

Overview

Base class for all middleware. Provides the standard Rack-style pattern:

def call(env)
  # pre-processing
  response = @app.call(env)
  # post-processing
  response
end

Subclasses MUST call @app.call(env) unless they are intentionally short-circuiting (e.g., returning a cached response).

Instance Method Summary collapse

Constructor Details

#initialize(app) ⇒ Base

Returns a new instance of Base.



18
19
20
# File 'lib/brute/middleware/base.rb', line 18

def initialize(app)
  @app = app
end

Instance Method Details

#call(env) ⇒ Object



22
23
24
# File 'lib/brute/middleware/base.rb', line 22

def call(env)
  @app.call(env)
end