Skip to content

Instantly share code, notes, and snippets.

@rakibulislam
Created November 9, 2020 16:38
Show Gist options
  • Save rakibulislam/864dca7937d609bac6316612b84057d9 to your computer and use it in GitHub Desktop.
Save rakibulislam/864dca7937d609bac6316612b84057d9 to your computer and use it in GitHub Desktop.
def foo(x, y)
  method(__method__).parameters.map do |_, name|
    binding.local_variable_get(name)
  end
end

foo(1, 2)  # => 1, 2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment