Last active
August 29, 2015 14:01
-
-
Save tadast/4203f5f1a55bdee61c09 to your computer and use it in GitHub Desktop.
ruby **options inconsistency
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 foo(a, *b, **c) | |
[a, b, c] | |
end | |
=> :foo | |
[16] » foo 10, {d: 40, e: 50} | |
=> [ | |
[0] 10, | |
[1] [], | |
[2] { | |
:d => 40, | |
:e => 50 | |
} | |
] | |
[17] » foo 10, {d: 40, e: 50}.with_indifferent_access | |
=> [ | |
[0] 10, | |
[1] [ | |
[0] { | |
"d" => 40, | |
"e" => 50 | |
} | |
], | |
[2] {} | |
] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment