Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/sys/windows/sys/filesystem/helper.rb

Overview

Reopen core Ruby classes here and add some custom methods.

Instance Method Summary collapse

Instance Method Details

#wincodeObject

Convenience method for converting strings to UTF-16LE for wide character functions that require it. – TODO: Use a refinement.



7
8
9
# File 'lib/sys/windows/sys/filesystem/helper.rb', line 7

def wincode
  (tr(File::SEPARATOR, File::ALT_SEPARATOR) + 0.chr).encode('UTF-16LE')
end