Skip to content

Instantly share code, notes, and snippets.

@ELLIOTTCABLE
Created September 26, 2008 21:50
Show Gist options
  • Save ELLIOTTCABLE/13210 to your computer and use it in GitHub Desktop.
Save ELLIOTTCABLE/13210 to your computer and use it in GitHub Desktop.
foo = lambda {p 'foo'}
def gaz &block
block.call
end
bar = method(:gaz).to_proc # => #<Proc:0x00027b3c@-:5>
bar.call(foo)
# ~> -:10:in `gaz': wrong number of arguments (1 for 0) (ArgumentError)
# ~> from -:10:in `to_proc'
# ~> from -:6:in `call'
# ~> from -:6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment