Class: Rackdapter::Config
- Inherits:
-
Object
- Object
- Rackdapter::Config
- Defined in:
- lib/rackdapter/config.rb
Instance Attribute Summary collapse
-
#apps ⇒ Object
Returns the value of attribute apps.
-
#log ⇒ Object
Returns the value of attribute log.
Instance Method Summary collapse
-
#initialize(path = '') ⇒ Config
constructor
A new instance of Config.
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
#apps ⇒ Object
Returns the value of attribute apps.
15 16 17 |
# File 'lib/rackdapter/config.rb', line 15 def apps @apps end |
#log ⇒ Object
Returns the value of attribute log.
15 16 17 |
# File 'lib/rackdapter/config.rb', line 15 def log @log end |