Skip to content

Instantly share code, notes, and snippets.

@clm-a
Created April 20, 2012 12:05
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 clm-a/2428103 to your computer and use it in GitHub Desktop.
Save clm-a/2428103 to your computer and use it in GitHub Desktop.
&method
# From : http://andrewjgrimm.wordpress.com/2011/10/03/in-ruby-method-passes-you/
["1", "2", "3"].map(&method(:Integer))
filenames = ["a.txt", "b.txt", "c.txt"]
texts = filenames.map(&File.method(:read))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment