Skip to content

Instantly share code, notes, and snippets.

@ingemar
Created September 21, 2010 15:03
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 ingemar/589807 to your computer and use it in GitHub Desktop.
Save ingemar/589807 to your computer and use it in GitHub Desktop.
#table must be a two columned cucumber table
keys = table.rows_hash.keys.map { |key| key.parameterize("_") }
attributes = keys.zip(table.rows_hash.values).flatten
attributes = Hash[*attributes]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment