Method: String#write_to_file
- Defined in:
- lib/pleasant_path/string.rb
#write_to_file(file) ⇒ self
Writes the String to the specified file
, overwriting the file if it exists. Creates the file if it does not exist, including any necessary parent directories. Returns the String.
42 43 44 45 |
# File 'lib/pleasant_path/string.rb', line 42 def write_to_file(file) file.to_pathname.write_text(self) self end |