class String

Public Instance Methods

to_path() click to toggle source

Convert a string directly into a Pathname object.

# File lib/pathname2.rb, line 1144
def to_path
  Pathname.new(self)
end
wincode() click to toggle source

Convenience method for converting strings to UTF-16LE for wide character functions that require it.

# File lib/pathname2.rb, line 39
def wincode
  if self.encoding.name != 'UTF-16LE'
    temp = self.dup
    (temp.tr(File::SEPARATOR, File::ALT_SEPARATOR) << 0.chr).encode('UTF-16LE')
  end
end