aboutsummaryrefslogtreecommitdiffstats
path: root/lib/plum/rack/config.rb
blob: f452a05e2bb84f5ea35fe37649b06b5ddef22e50 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# frozen-string-literal: true

module Plum
  module Rack
    class Config
      DEFAULT_CONFIG = {
        listeners: [],
        debug: false,
        log: nil, # $stdout
        server_push: true,
        threadpool_size: 1,
      }.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