Class: AmberbitConfig::Config
- Inherits:
-
Object
- Object
- AmberbitConfig::Config
- Defined in:
- lib/amberbit-config/config.rb
Overview
Class responsible for loading, parsing and merging configuration from yaml files.
Instance Attribute Summary collapse
-
#custom ⇒ Object
readonly
Returns the value of attribute custom.
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#default ⇒ Object
readonly
Returns the value of attribute default.
Instance Method Summary collapse
-
#initialize(defaults_file, customs_file) ⇒ Config
constructor
A new instance of Config.
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
#custom ⇒ Object (readonly)
Returns the value of attribute custom.
7 8 9 |
# File 'lib/amberbit-config/config.rb', line 7 def custom @custom end |
#data ⇒ Object (readonly)
Returns the value of attribute data.
7 8 9 |
# File 'lib/amberbit-config/config.rb', line 7 def data @data end |
#default ⇒ Object (readonly)
Returns the value of attribute default.
7 8 9 |
# File 'lib/amberbit-config/config.rb', line 7 def default @default end |