Created
March 13, 2013 21:35
-
-
Save rpocklin/5156541 to your computer and use it in GitHub Desktop.
coerce a single or array parameter into array - keeping args flexible
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
def some_method(single_or_array) | |
single_or_array = [*single_or_array] | |
# do awesome stuff here... | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment