Created
June 15, 2011 23:03
-
-
Save Amokrane/1028340 to your computer and use it in GitHub Desktop.
inject is evil (by @tenderlove)
This file contains 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
%w{ | |
Foo | |
Bar | |
Baz | |
}.inject(Object) { |klass, string| | |
klass.const_get(string.to_sym) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment