Class: Corrupt::Config
- Inherits:
-
Object
- Object
- Corrupt::Config
- Includes:
- Singleton
- Defined in:
- lib/corrupt/config.rb
Overview
Singleton class to store Corrupt configuration.
Instance Attribute Summary collapse
-
#options ⇒ Object
Returns the value of attribute options.
Class Method Summary collapse
-
.[](key) ⇒ Object
Access the configured
key
‘s value. -
.setup(file) ⇒ Object
Setup Config with the YAML
file
.
Instance Attribute Details
#options ⇒ Object
Returns the value of attribute options.
7 8 9 |
# File 'lib/corrupt/config.rb', line 7 def @options end |
Class Method Details
.[](key) ⇒ Object
Access the configured key
‘s value.
10 11 12 13 |
# File 'lib/corrupt/config.rb', line 10 def self.[](key) raise 'Config not setup' unless @setup instance.[key] end |
.setup(file) ⇒ Object
Setup Config with the YAML file
.
16 17 18 19 |
# File 'lib/corrupt/config.rb', line 16 def self.setup(file) instance. = YAML.load_file(file)[Corrupt.env] @setup = true end |