aboutsummaryrefslogtreecommitdiff
path: root/lib/leap_cli/config/secrets.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/leap_cli/config/secrets.rb')
-rw-r--r--lib/leap_cli/config/secrets.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/leap_cli/config/secrets.rb b/lib/leap_cli/config/secrets.rb
index 963fd6b..4450b9c 100644
--- a/lib/leap_cli/config/secrets.rb
+++ b/lib/leap_cli/config/secrets.rb
@@ -13,6 +13,11 @@ module LeapCli; module Config
@discovered_keys = {}
end
+ # we can't use fetch() or get(), since those already have special meanings
+ def retrieve(key, environment=nil)
+ self.fetch(environment||'default', {})[key.to_s]
+ end
+
def set(key, value, environment=nil)
environment ||= 'default'
key = key.to_s