aboutsummaryrefslogtreecommitdiffstats
path: root/lib/plum/rack/config.rb
blob: f7284dcfc60da5c512ee174f14875c9364c8831f (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
# -*- 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