Created
October 5, 2011 18:19
-
-
Save julioterra/1265221 to your computer and use it in GitHub Desktop.
creating an enumerator with the enum_for method
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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