Class: Brute::Middleware::Base
- Inherits:
-
Object
- Object
- Brute::Middleware::Base
- 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).
Direct Known Subclasses
CompactionCheck, DoomLoopDetection, MessageTracking, OTel::Span, OTel::TokenUsage, OTel::ToolCalls, OTel::ToolResults, ReasoningNormalizer, Retry, SessionPersistence, TokenTracking, ToolErrorTracking, Tracing
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app) ⇒ Base
constructor
A new instance of Base.
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 |