Skip to content

Instantly share code, notes, and snippets.

@thejefflarson
Created May 26, 2010 20:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thejefflarson/415038 to your computer and use it in GitHub Desktop.
Save thejefflarson/415038 to your computer and use it in GitHub Desktop.
#State,attribute
#California,sunshine
#California,beaches
#Texas,oil
#Texas,rock_festivals
s = TableFu.new(csv)
s.faceted_by("State").each do |state|
puts state.row
end
#or even better
s.faceted_by("State").each do |state|
puts state.row['attribute']
end
# This is the current api though:
# I'm confused at what you'd wnat it to do
#
# when you facet you get tf instances not rows
s = TableFu.new(csv)
s.faceted_by("State").each do |state|
state.rows.each do |row|
puts row
end
end
# row[] is the hotness. I'll push a fix
s.faceted_by("State").each do |state|
state.rows.each do |row|
puts state.row['attribute']
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment