Method: PasswordSafe::Keyring#add

Defined in:
lib/passwordsafe/keyring.rb

#add(name, password) ⇒ Object

Raises:



22
23
24
25
26
# File 'lib/passwordsafe/keyring.rb', line 22

def add name, password
  raise KeyExistsException, "Key already exists in keyring, if you'd like to add it remove the existing key", caller if @ring.has_key?(name)
  @ring.store(name, password)
  @safe.write_safe @ring
end