1
0
Fork 0
mirror of https://github.com/pry/pry.git synced 2022-11-09 12:35:05 -05:00

Simplify getting a method from a binding

This commit is contained in:
Conrad Irwin 2012-09-11 19:31:03 -07:00
parent 7297a471e9
commit c2e58d8e9a

View file

@ -67,7 +67,7 @@ class Pry
nil
else
method = begin
new(b.eval("::Object.instance_method(:method).bind(self).call(#{meth_name.to_s.inspect})"))
new(Object.instance_method(:method).bind(b.eval("self")).call(meth_name))
rescue NameError, NoMethodError
Disowned.new(b.eval('self'), meth_name.to_s)
end