Skip to content

Instantly share code, notes, and snippets.

@jmmarco
Created October 13, 2016 20:10
Show Gist options
  • Save jmmarco/37747f533f684c160ea5b8a25ed25dd1 to your computer and use it in GitHub Desktop.
Save jmmarco/37747f533f684c160ea5b8a25ed25dd1 to your computer and use it in GitHub Desktop.
Appends a single item to a CSV file
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