Method: Pry::Method.from_class
- Defined in:
- lib/pry/method.rb
.from_class(klass, name, target = TOPLEVEL_BINDING) ⇒ Pry::Method? Also known as: from_module
Given a ‘Class` or `Module` and the name of a method, try to instantiate a `Pry::Method` containing the instance method of that name. Return `nil` if no such method exists.
136 137 138 139 140 |
# File 'lib/pry/method.rb', line 136 def from_class(klass, name, target = TOPLEVEL_BINDING) new(lookup_method_via_binding(klass, name, :instance_method, target)) rescue StandardError nil end |