Class: Muzak::Config
- Inherits:
-
Object
- Object
- Muzak::Config
- Defined in:
- lib/muzak/config.rb
Overview
Muzak's static configuration dumping ground. Key-value pairs are loaded from CONFIG_FILE and translated from kebab-case to snake_case methods.
Class Method Summary collapse
-
.method_missing(method, *args) ⇒ false
Catches all undefined configuration keys and defaults them to false.
-
.plugin?(pname) ⇒ Boolean
Whether or not the given plugin is configured.
- .sync! ⇒ Object
Class Method Details
.method_missing(method, *args) ⇒ false
Catches all undefined configuration keys and defaults them to false.
45 46 47 |
# File 'lib/muzak/config.rb', line 45 def self.method_missing(method, *args) false end |
.plugin?(pname) ⇒ Boolean
Note:
the truth-value of this method is used to determine which plugins should be loaded.
Returns whether or not the given plugin is configured.
56 57 58 |
# File 'lib/muzak/config.rb', line 56 def self.plugin?(pname) respond_to? "plugin_#{pname}" end |
.sync! ⇒ Object
49 50 51 |
# File 'lib/muzak/config.rb', line 49 def self.sync! File.open(CONFIG_FILE, "w") { |io| io.write @config.to_yaml } end |