Class: KAG::Config
- Inherits:
-
SymbolTable
- Object
- SymbolTable
- KAG::Config
- Includes:
- Singleton
- Defined in:
- lib/kag/config.rb
Constant Summary collapse
Class Method Summary collapse
Instance Method Summary collapse
- #_get_config ⇒ Object
-
#initialize ⇒ Config
constructor
A new instance of Config.
- #reload ⇒ Object
Constructor Details
#initialize ⇒ Config
Returns a new instance of Config.
11 12 13 14 |
# File 'lib/kag/config.rb', line 11 def initialize super self.merge!(self._get_config) end |
Class Method Details
.data ⇒ Object
29 30 31 |
# File 'lib/kag/config.rb', line 29 def self.data @@data end |
Instance Method Details
#_get_config ⇒ Object
16 17 18 19 20 21 22 |
# File 'lib/kag/config.rb', line 16 def _get_config if File.exists?("config/config.json") SymbolTable.new(JSON.parse(::IO.read("config/config.json"))) else raise 'Error loading config file from config/config.json' end end |
#reload ⇒ Object
24 25 26 27 |
# File 'lib/kag/config.rb', line 24 def reload puts "Reloading configuration file..." self.merge!(self._get_config) end |