class Security::GenericPassword

Public Class Methods

add(service, account, password, options = {}) click to toggle source
# File lib/security/password.rb, line 66
def add(service, account, password, options = {})
  options[:a] = account
  options[:s] = service
  options[:w] = password

  system "security add-generic-password #{flags_for_options(options)}"
end
delete(options) click to toggle source
# File lib/security/password.rb, line 78
def delete(options)
  system "security delete-generic-password #{flags_for_options(options)}"
end
find(options) click to toggle source
# File lib/security/password.rb, line 74
def find(options)
  password_from_output(`security 2>&1 find-generic-password -g #{flags_for_options(options)}`)
end

Private Class Methods

flags_for_options(options = {}) click to toggle source
Calls superclass method Security::Password::flags_for_options
# File lib/security/password.rb, line 84
def flags_for_options(options = {})
  options[:s] ||= options.delete(:service)
  super(options)
end