Project

General

Profile

Actions

Feature #12043

closed

Add a method to NoMethodError that tells if private methods are callable at the time of

Added by yuki24 (Yuki Nishijima) almost 6 years ago. Updated almost 6 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
-
[ruby-core:73630]

Description

I've briefly talked about this to Sasada-san, but also wanted to hear from other committers. I would like to add a method to NoMethodError that tells whether or not private methods are callable from the line where the exception is raised. An example would be like this:

begin
  raies "Error" # 
rescue NoMethodError => no_method_error
  no_method_error.private_method_callable? # => true
end

The only use case I can think of is the spell checker in the did_you_mean gem and I'm not actually sure how useful it would be for others.

Please let me know what you think, I'm open to suggestions.

Actions

Also available in: Atom PDF