Skip to content

Instantly share code, notes, and snippets.

@julioterra
Created October 5, 2011 18:19
Show Gist options
  • Select an option

  • Save julioterra/1265221 to your computer and use it in GitHub Desktop.

Select an option

Save julioterra/1265221 to your computer and use it in GitHub Desktop.
creating an enumerator with the enum_for method
ingredients = ["tomato", "arugula", "garlic", "olive oil", "balsamic", "parmesan"]
enum = ingredients.enum_for(:select)
p enum.each { |n| n =~ /ar/ }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment