Class: Keyring

Inherits:
Object
  • Object
show all
Defined in:
lib/keyring/version.rb,
lib/keyring.rb

Overview

keyring: System keyring abstraction library License: MIT (www.opensource.org/licenses/mit-license.php)

Defined Under Namespace

Classes: Backend, CLI

Constant Summary collapse

VERSION =
"0.3.0"

Instance Method Summary collapse

Constructor Details

#initialize(backend = nil) ⇒ Keyring

If you want a particular backend then use, for example, Keyring.new(Keyring::Backend::Memory.new)


11
12
13
# File 'lib/keyring.rb', line 11

def initialize(backend=nil)
  @backend = backend || Keyring::Backend.create
end

Instance Method Details

#delete_password(service, username) ⇒ Object


21
22
23
# File 'lib/keyring.rb', line 21

def delete_password(service, username)
  @backend.delete_password(service, username)
end

#get_password(service, username) ⇒ Object


15
16
17
# File 'lib/keyring.rb', line 15

def get_password(service, username)
  @backend.get_password(service, username)
end

#set_password(service, username, password) ⇒ Object


18
19
20
# File 'lib/keyring.rb', line 18

def set_password(service, username, password)
  @backend.set_password(service, username, password)
end