Skip to content

Instantly share code, notes, and snippets.

@daveworth
Created November 9, 2011 18:46
Show Gist options
  • Select an option

  • Save daveworth/1352484 to your computer and use it in GitHub Desktop.

Select an option

Save daveworth/1352484 to your computer and use it in GitHub Desktop.
[["websites", /website/i], ["emails", /email/i], ["phones", /phone|fax|cell/i]].each do |getter_data|
data_type, regex = *getter_data
@daveworth
Copy link
Author

AL: thanks! I knew the latter and I suppose it's almost identical to what I need to accomplish above. After converting to a hash then I can do #each and the block variables are the keys/values resp.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment