class GPGME::ImportStatus

Attributes

action[R]

Public Instance Methods

fingerprint() click to toggle source
# File lib/schleuder/gpgme/import_status.rb, line 28
def fingerprint
  orig_fingerprint.encode(Encoding::US_ASCII)
end
Also aliased as: orig_fingerprint
orig_fingerprint()

Force encoding, some databases save “ASCII-8BIT” as binary data.

Alias for: fingerprint
set_action() click to toggle source

Unfortunately in initialize() @status and @result are not yet initialized.

# File lib/schleuder/gpgme/import_status.rb, line 6
def set_action
  @action ||= if self.result > 0
                # An error happened.
                # TODO: Give details by going through the list of errors in
                # "gpg-errors.h" and find out which is present here.
                'error'
              else
                # TODO: refactor with Ctx#translate_import_data
                case self.status
                when 0
                  'unchanged'
                when IMPORT_NEW
                  'imported'
                else
                  'updated'
                end
              end
  self
end