class Device::Signature

Constants

CONVERTED
FILE
FILE_NOT_FOUND
IS_THE_SAME

Public Class Methods

convert() click to toggle source
# File lib/device/signature.rb, line 11
def self.convert
  load
  return FILE_NOT_FOUND unless @file

  if must_convert?
    @file.update_attributes({ 'signer' => DaFunk::ParamsDat.file['signer'] })
    return CONVERTED
  end
  IS_THE_SAME
end
load() click to toggle source
# File lib/device/signature.rb, line 26
def self.load
  @file = FileDb.new FILE
end
must_convert?() click to toggle source
# File lib/device/signature.rb, line 22
def self.must_convert?
  DaFunk::ParamsDat.file['signer'] && DaFunk::ParamsDat.file['signer'] != @file['signer']
end