Created
October 13, 2016 20:10
-
-
Save jmmarco/37747f533f684c160ea5b8a25ed25dd1 to your computer and use it in GitHub Desktop.
Appends a single item to a CSV file
This file contains hidden or 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
module ItemAdder | |
# This method appends a single item to the CSV file | |
def self.write(filename, item) | |
CSV.open(filename, "a+") do |csv| | |
csv << [item.description] | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment