Skip to content

Instantly share code, notes, and snippets.

@ursm
Forked from moro/gist:166394
Created August 12, 2009 08:53
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 ursm/166408 to your computer and use it in GitHub Desktop.
Save ursm/166408 to your computer and use it in GitHub Desktop.
class Array
def to_proc
proc {|o| o.send(*self) }
end
end
# p (1..10).map{|i|i.divmod(2)}
p (1..10).map(&[:divmod,2])
content = "Hello World"
File.open("/tmp/foobar.txt", "w", &[:puts, content])
puts File.read("/tmp/foobar.txt")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment