Class: Vayacondios::Server::Configuration

Inherits:
Configuration show all
Defined in:
lib/vayacondios/server/configuration.rb

Instance Attribute Summary

Attributes inherited from Configuration

#base_filename, #load_order

Instance Method Summary collapse

Methods inherited from Configuration

#[], #apply_all, #global, #initialize, #overlay, #project, #resolve!, #resolved?, #resolved_settings

Constructor Details

This class inherits a constructor from Vayacondios::Configuration

Instance Method Details

#defaultsObject



4
5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/vayacondios/server/configuration.rb', line 4

def defaults
  %w[development test production].inject({}) do |default_conf, type|
    default_conf[type.to_sym] = {}
    default_conf[type.to_sym][:database] = {
      driver:      'mongo',
      host:        'localhost',
      port:        27017,
      name:        "vayacondios_#{type}",
      connections: 20,
    }
    default_conf
  end
end

#env(handle = nil) ⇒ Object



18
19
20
21
# File 'lib/vayacondios/server/configuration.rb', line 18

def env(handle = nil)
  handle ||= :development
  resolved_settings[handle.to_sym] || {}
end