Class: Keys::Core::Environment::Keychain
- Inherits:
-
Object
- Object
- Keys::Core::Environment::Keychain
- Defined in:
- lib/core/environment/keychain.rb
Instance Method Summary collapse
-
#fetch(key:) ⇒ String
Fetches the value of the keychain access item with the given key.
-
#initialize ⇒ Keychain
constructor
A new instance of Keychain.
Constructor Details
#initialize ⇒ Keychain
Returns a new instance of Keychain.
15 16 17 |
# File 'lib/core/environment/keychain.rb', line 15 def initialize self.keychain = OSXKeychain.new end |
Instance Method Details
#fetch(key:) ⇒ String
Fetches the value of the keychain access item with the given key.
22 23 24 25 26 |
# File 'lib/core/environment/keychain.rb', line 22 def fetch(key:) keychain[key, Keys::Globals.key_access_identifier] rescue StandardError puts "❌ Error fetching the key: #{key} from Keychain." end |