module PeAccounting

Constants

VERSION

Public Instance Methods

date(datetime) click to toggle source
# File lib/pe_accounting/helpers.rb, line 10
def date(datetime)
  datetime.strftime("%Y-%m-%d")
end
file(name, file) click to toggle source
# File lib/pe_accounting/helpers.rb, line 3
def file(name, file)
  return {
    "filename": name,
    "data": file_to_hex(file)
  }
end
file_to_hex(f) click to toggle source

Converts a File to its hexadecimal representation

@param f [File] A binary file. @return [String] A string representing the file in hexadecimal form.

# File lib/pe_accounting/helpers.rb, line 20
def file_to_hex(f)
  f.unpack('H*').first
end