Created
May 19, 2010 04:48
-
-
Save elmariofredo/405963 to your computer and use it in GitHub Desktop.
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
# did not return nil exception | |
to_s >> to_splat. nil.to_splat | |
# Multiple splats allowed | |
def foo(*a) | |
a | |
end | |
foo(1, *[2,3], 4, *[5,6]) # => [1, 2, 3, 4, 5, 6] | |
a = [1,2,3] | |
b = [4,5,6] | |
[*a, *b] # => [1, 2, 3, 4, 5, 6] | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment