Class: AmberbitConfig::Config

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

Overview

Class responsible for loading, parsing and merging configuration from yaml files.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(defaults_file, customs_file) ⇒ Config

Returns a new instance of Config.



9
10
11
12
13
14
# File 'lib/amberbit-config/config.rb', line 9

def initialize(defaults_file, customs_file)
  @default = parse_yaml defaults_file
  @custom  = parse_yaml customs_file

  @data = deep_merge default, custom
end

Instance Attribute Details

#customObject (readonly)

Returns the value of attribute custom.



7
8
9
# File 'lib/amberbit-config/config.rb', line 7

def custom
  @custom
end

#dataObject (readonly)

Returns the value of attribute data.



7
8
9
# File 'lib/amberbit-config/config.rb', line 7

def data
  @data
end

#defaultObject (readonly)

Returns the value of attribute default.



7
8
9
# File 'lib/amberbit-config/config.rb', line 7

def default
  @default
end