Skip to content

Instantly share code, notes, and snippets.

@tadast
Last active August 29, 2015 14:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tadast/4203f5f1a55bdee61c09 to your computer and use it in GitHub Desktop.
Save tadast/4203f5f1a55bdee61c09 to your computer and use it in GitHub Desktop.
ruby **options inconsistency
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