Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/pathname2.rb,
lib/pathname2.rb
Direct Known Subclasses
Instance Method Summary collapse
-
#to_path ⇒ Object
Convert a string directly into a Pathname object.
-
#wincode ⇒ Object
Convenience method for converting strings to UTF-16LE for wide character functions that require it.
Instance Method Details
#to_path ⇒ Object
Convert a string directly into a Pathname object.
1137 1138 1139 |
# File 'lib/pathname2.rb', line 1137 def to_path Pathname.new(self) end |
#wincode ⇒ Object
Convenience method for converting strings to UTF-16LE for wide character functions that require it.
39 40 41 42 43 44 |
# 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 |