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
}.freeze

Instance Method Summary collapse

Constructor Details

#initialize(config = {}) ⇒ Config

Returns a new instance of Config.


12
13
14
# File 'lib/plum/rack/config.rb', line 12

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

Instance Method Details

#[](key) ⇒ Object


16
17
18
# File 'lib/plum/rack/config.rb', line 16

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

#[]=(key, value) ⇒ Object


20
21
22
# File 'lib/plum/rack/config.rb', line 20

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

#to_sObject


24
25
26
# File 'lib/plum/rack/config.rb', line 24

def to_s
  @config.to_s
end