| Class | Pry::Method::WeirdMethodLocator |
| In: |
lib/pry/method/weird_method_locator.rb
|
| Parent: | Object |
This class is responsible for locating the real `Pry::Method` object captured by a binding.
Given a `Binding` from inside a method and a ‘seed’ Pry::Method object, there are primarily two situations where the seed method doesn‘t match the Binding:
while the original was renamed to something else. For 1. we search vertically up the inheritance chain, and for 2. we search laterally along the object‘s method table.
When we locate the method that matches the Binding we wrap it in Pry::Method and return it, or return nil if we fail.
| method | [RW] | |
| target | [RW] |
@param [Pry::Method] method The seed method. @param [Binding] target The Binding that captures the method
we want to locate.
Whether the given method object matches the associated binding. If the method object does not match the binding, then it‘s most likely not the method captured by the binding, and we must commence a search.
@param [Pry::Method] method @param [Binding] b @return [Boolean]
@return [Boolean] Whether the Pry::Method is unrecoverable
This usually happens when the method captured by the Binding has been subsequently deleted.