X-Git-Url: https://git.r.bdr.sh/rbdr/lyricli.rb/blobdiff_plain/823e558b5cd2ec219d0fc7226c54f2ee7ad807d2..b2ac68932fa671151d3ab3115c565fa9ad06420c:/doc/Lyricli/Configuration.html?ds=inline diff --git a/doc/Lyricli/Configuration.html b/doc/Lyricli/Configuration.html index 7ca3571..54b439c 100644 --- a/doc/Lyricli/Configuration.html +++ b/doc/Lyricli/Configuration.html @@ -6,7 +6,7 @@
+This class handles the configuration of Lyricli +
+ + ++Ensure this is only called once. +
++Access configuration properties, loads config if needed beforehand. +
++Assigns a new value to a configuration key, loads config if needed and +saves it after updating. +
++Deletes a key from the configuration, loads config if needed and saves it +after deleting. +
+-A new instance of Configuration. +Defines the paths to the default and user configuration files. +
++Loads the configuration from the user file, attempts to create it from +defaults if it’s not present. +
++Serializes the `@config` Hash to JSON and saves it to a file.
-A new instance of Configuration +Defines the paths to the default and user configuration files
@@ -261,17 +360,19 @@ A new instance of Configuration-4 -5 -6 -7+7 +8 +9 +10 +11
# File 'lib/lyricli/configuration.rb', line 4 +# File 'lib/lyricli/configuration.rb', line 7 def initialize @config_path = "~/.lyricli.conf" @defaults_path = "defaults.json" + @config = nil end
-11 -12 -13+17 +18 +19 |
- # File 'lib/lyricli/configuration.rb', line 11 +# File 'lib/lyricli/configuration.rb', line 17 def self.instance @@instance @@ -324,25 +438,77 @@ A new instance of Configuration |