Class: Rackdapter::Config

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path = '') ⇒ Config

Returns a new instance of Config.



17
18
19
20
21
22
23
24
25
26
27
# File 'lib/rackdapter/config.rb', line 17

def initialize(path='')
  @apps = {}
  config = YAML.load(File.read(path))
  if config
    config.each do |k,v|
      @apps[k.to_sym] = v
    end
    @apps[:proxy] ||= {}
    @apps[:proxy].merge!("type" => "proxy", "instances" => 1, "base_port" => 0)
  end
end

Instance Attribute Details

#appsObject

Returns the value of attribute apps.



15
16
17
# File 'lib/rackdapter/config.rb', line 15

def apps
  @apps
end

#logObject

Returns the value of attribute log.



15
16
17
# File 'lib/rackdapter/config.rb', line 15

def log
  @log
end