Class: Jupiter::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/jupiter/configuration.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Configuration

Returns a new instance of Configuration.



10
11
12
13
14
15
# File 'lib/jupiter/configuration.rb', line 10

def initialize(options = {})
  @hosts      = options.fetch(:hosts) {[]}
  @vmusers    = options.fetch(:vmusers) { {} }
  @templates  = options.fetch(:templates) { {} }
  @nagios     = options.fetch(:nagios) { {} }
end

Instance Attribute Details

#hostsObject

Returns the value of attribute hosts.



3
4
5
# File 'lib/jupiter/configuration.rb', line 3

def hosts
  @hosts
end

#nagiosObject

Returns the value of attribute nagios.



3
4
5
# File 'lib/jupiter/configuration.rb', line 3

def nagios
  @nagios
end

#templatesObject

Returns the value of attribute templates.



3
4
5
# File 'lib/jupiter/configuration.rb', line 3

def templates
  @templates
end

#vmusersObject

Returns the value of attribute vmusers.



3
4
5
# File 'lib/jupiter/configuration.rb', line 3

def vmusers
  @vmusers
end

Class Method Details

.load_from_yaml!Object



5
6
7
8
# File 'lib/jupiter/configuration.rb', line 5

def self.load_from_yaml!
  config = YAML.load_file('config.yaml')
  new(config)
end