Methods
Constants
| NAMES_TO_EXCLUDE | = | { NilClass => nil.methods } |
| RB_RESERVED_WORDS | = | %i( alias case def defined? elsif end ensure for rescue super undef unless until when while yield ) |
The Also see |
||
Attributes
| [R] | method_name | |
| [R] | receiver |
Class Public methods
new(exception) Link
Instance Public methods
corrections() Link
# File ruby/lib/did_you_mean/spell_checkers/method_name_checker.rb, line 48 def corrections @corrections ||= begin dictionary = method_names dictionary = RB_RESERVED_WORDS + dictionary if @private_call SpellChecker.new(dictionary: dictionary).correct(method_name) - names_to_exclude end end
method_names() Link
# File ruby/lib/did_you_mean/spell_checkers/method_name_checker.rb, line 57 def method_names if Object === receiver method_names = receiver.methods + receiver.singleton_methods method_names += receiver.private_methods if @private_call method_names.uniq! # Assume that people trying to use a writer are not interested in a reader # and vice versa if method_name.match?(/=\Z/) method_names.select! { |name| name.match?(/=\Z/) } else method_names.reject! { |name| name.match?(/=\Z/) } end method_names else [] end end