diff options
Diffstat (limited to 'lib/leap_cli/config/secrets.rb')
-rw-r--r-- | lib/leap_cli/config/secrets.rb | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/lib/leap_cli/config/secrets.rb b/lib/leap_cli/config/secrets.rb new file mode 100644 index 0000000..00d0cd6 --- /dev/null +++ b/lib/leap_cli/config/secrets.rb @@ -0,0 +1,33 @@ +# +# +# A class for the secrets.json file +# +# + +module LeapCli; module Config + + class Secrets < Object + attr_reader :node_list + + def initialize(manager=nil) + super(manager) + @discovered_keys = {} + end + + def set(key, value) + key = key.to_s + @discovered_keys[key] = true + self[key] ||= value + end + + def dump_json + self.each_key do |key| + unless @discovered_keys[key] + self.delete(key) + end + end + super + end + end + +end; end |