Skip to content

Instantly share code, notes, and snippets.

@asmallteapot
Created November 18, 2010 21:10
Show Gist options
  • Save asmallteapot/705626 to your computer and use it in GitHub Desktop.
Save asmallteapot/705626 to your computer and use it in GitHub Desktop.
# open a hash of FasterCSV generators
data = { :table1 => nil, :table2 => nil, :table3 => nil, :table4 => nil }
data[:table1] = FasterCSV.generate do |data[:table1]|
data[:table2] = FasterCSV.generate do |data[:table2]|
data[:table3] = FasterCSV.generate do |data[:table3]|
data[:table4] = FasterCSV.generate do |data[:table4]|
# do stuff with it
# close them, rewriting the data to CSV inside the same hash
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment