Skip to content

Instantly share code, notes, and snippets.

@ryanlecompte
Created January 27, 2012 01:23
Show Gist options
  • Save ryanlecompte/1686333 to your computer and use it in GitHub Desktop.
Save ryanlecompte/1686333 to your computer and use it in GitHub Desktop.
Using /Users/ryan/.rvm/gems/ruby-1.9.2-p290
[1] pry(main)> class Foo
[1] pry(main)* define_method(:hmm, proc { |x,y| p [x,y] })
[1] pry(main)* end
=> #<Proc:0x007f8cab911060@(pry):2 (lambda)>
[2] pry(main)> Foo.new.hmm(1)
ArgumentError: wrong number of arguments (1 for 2)
from (pry):2:in `block in <class:Foo>'
[3] pry(main)> Foo.new.hmm(1,2)
[1, 2]
=> [1, 2]
[4] pry(main)>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment