Created
August 8, 2016 21:31
-
-
Save thescubageek/e6c42986659b870dca1b32b0822d3d2a to your computer and use it in GitHub Desktop.
Array to File
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def array_to_file(arr, file) | |
File.open(file, 'w') { |f| f.write(arr.join("\n")) } unless arr.blank? | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment