Class: Keys::Core::Environment::Keychain

Inherits:
Object
  • Object
show all
Defined in:
lib/core/environment/keychain.rb

Instance Method Summary collapse

Constructor Details

#initializeKeychain

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.

Parameters:

  • key (String)

    the key of the keychain access item to fetch

Returns:

  • (String)

    the value of the keychain access item



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