Skip to content

Instantly share code, notes, and snippets.

@rickhull
Last active December 22, 2015 21:19
Show Gist options
  • Save rickhull/7bc598f3fec19a366c67 to your computer and use it in GitHub Desktop.
Save rickhull/7bc598f3fec19a366c67 to your computer and use it in GitHub Desktop.
def foo(bar)
'baz'
end
# can I do something like:
[1,2,3,4].map(&foo)
# => ['baz', 'baz', 'baz', 'baz']
# heftig: yes:
[1,2,3,4].map(&method(:foo))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment