Skip to content

Instantly share code, notes, and snippets.

@namusyaka
Created June 21, 2015 06:20
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 namusyaka/16019a9fb929a3efe4c3 to your computer and use it in GitHub Desktop.
Save namusyaka/16019a9fb929a3efe4c3 to your computer and use it in GitHub Desktop.
ruby-2.1.1と2.2.2で**の扱いが異なる件
def a(**options)
options
end
def b(**options)
a(foo: true, **options)
end
# 2.1だと{:foo=>true}, 2.2だと{:foo=>false}が出力される。
# 2.1が正しいように思う。
p b(foo: false)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment