summary refs log tree commit
path: root/lib/rack/config.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rack/config.rb')
-rw-r--r--lib/rack/config.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/rack/config.rb b/lib/rack/config.rb
new file mode 100644
index 00000000..c6d446c0
--- /dev/null
+++ b/lib/rack/config.rb
@@ -0,0 +1,15 @@
+module Rack
+  # Rack::Config modifies the environment using the block given during
+  # initialization.
+  class Config
+    def initialize(app, &block)
+      @app = app
+      @block = block
+    end
+
+    def call(env)
+      @block.call(env)
+      @app.call(env)
+    end
+  end
+end