Skip to content

Fix a few inconsistencies in the README#209

Open
duffuniverse wants to merge 1 commit into
ruby:masterfrom
duffuniverse:fix-inconsistencies-in-readme
Open

Fix a few inconsistencies in the README#209
duffuniverse wants to merge 1 commit into
ruby:masterfrom
duffuniverse:fix-inconsistencies-in-readme

Conversation

@duffuniverse

Copy link
Copy Markdown

Detail

# Ruby 3.4.9

no_method_error = begin
                    1.zeor?
                  rescue NoMethodError => error
                    error
                  end

no_method_error.message
# => "undefined method 'zeor?' for an instance of Integer"

no_method_error.original_message
# => "undefined method 'zeor?' for an instance of Integer"

no_method_error.detailed_message(highlight: false)
# => "undefined method 'zeor?' for an instance of Integer (NoMethodError)\nDid you mean?  zero?"

Exception.method_defined?(:detailed_message)
# => true

https://github.com/ruby/did_you_mean/blob/6740bdcb2844541b46f5244c21adea8386a23607/lib/did_you_mean/core_ext/name_error.rb

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant