lib/timber/integrations/rack/http_context.rb in timber-2.0.24 vs lib/timber/integrations/rack/http_context.rb in timber-2.1.0.rc1
- old
+ new
@@ -1,13 +1,11 @@
+require "timber/integrations/rack/middleware"
+
module Timber
module Integrations
module Rack
- # Reponsible for adding the HTTP context for applications that use `Rack`.
- class HTTPContext
- def initialize(app)
- @app = app
- end
-
+ # A Rack middleware that is reponsible for adding the HTTP context {Timber::Contexts::HTTP}.
+ class HTTPContext < Middleware
def call(env)
request = Util::Request.new(env)
context = Contexts::HTTP.new(
method: request.request_method,
path: request.path,
\ No newline at end of file