Class: Plum::Rack::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/plum/rack/config.rb

Constant Summary collapse

DEFAULT_CONFIG =
{
  listeners: [],
  debug: false,
  log: nil, # $stdout
  server_push: true,
  threaded: false,
  threadpool_size: 20,
}.freeze

Instance Method Summary collapse

Constructor Details

#initialize(config = {}) ⇒ Config

Returns a new instance of Config.



14
15
16
# File 'lib/plum/rack/config.rb', line 14

def initialize(config = {})
  @config = DEFAULT_CONFIG.merge(config)
end

Instance Method Details

#[](key) ⇒ Object



18
19
20
# File 'lib/plum/rack/config.rb', line 18

def [](key)
  @config[key]
end

#[]=(key, value) ⇒ Object



22
23
24
# File 'lib/plum/rack/config.rb', line 22

def []=(key, value)
  @config[key] = value
end

#to_sObject



26
27
28
# File 'lib/plum/rack/config.rb', line 26

def to_s
  @config.to_s
end