Class: Lyricli::Configuration
- Inherits:
-
Object
- Object
- Lyricli::Configuration
- Defined in:
- lib/lyricli/configuration.rb
Constant Summary
- @@instance =
Configuration.new
Class Method Summary (collapse)
Instance Method Summary (collapse)
- - (Object) [](key)
- - (Object) []=(key, value)
-
- (Configuration) initialize
constructor
A new instance of Configuration.
Constructor Details
- (Configuration) initialize
A new instance of Configuration
4 5 6 7 |
# File 'lib/lyricli/configuration.rb', line 4 def initialize @config_path = "~/.lyricli.conf" @defaults_path = "defaults.json" end |
Class Method Details
+ (Object) instance
11 12 13 |
# File 'lib/lyricli/configuration.rb', line 11 def self.instance @@instance end |
Instance Method Details
- (Object) [](key)
15 16 17 18 |
# File 'lib/lyricli/configuration.rb', line 15 def [](key) load_config unless @config @config[key] end |
- (Object) []=(key, value)
20 21 22 23 24 |
# File 'lib/lyricli/configuration.rb', line 20 def []=(key, value) load_config unless @config @config[key] = value save_config end |