aboutsummaryrefslogtreecommitdiffstats
path: root/lib/plum/rack/config.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/plum/rack/config.rb')
-rw-r--r--lib/plum/rack/config.rb29
1 files changed, 29 insertions, 0 deletions
diff --git a/lib/plum/rack/config.rb b/lib/plum/rack/config.rb
new file mode 100644
index 0000000..b75fd08
--- /dev/null
+++ b/lib/plum/rack/config.rb
@@ -0,0 +1,29 @@
+# -*- frozen-string-literal: true -*-
+module Plum
+ module Rack
+ class Config
+ DEFAULT_CONFIG = {
+ listeners: [],
+ debug: false,
+ log: nil, # $stdout
+ server_push: true
+ }.freeze
+
+ def initialize(config = {})
+ @config = DEFAULT_CONFIG.merge(config)
+ end
+
+ def [](key)
+ @config[key]
+ end
+
+ def []=(key, value)
+ @config[key] = value
+ end
+
+ def to_s
+ @config.to_s
+ end
+ end
+ end
+end