new(no_matching_pattern_key_error)click to toggle source
# File ruby-3.1.2/lib/did_you_mean/spell_checkers/pattern_key_name_checker.rb, line 5definitialize(no_matching_pattern_key_error)
@key = no_matching_pattern_key_error.key@keys = no_matching_pattern_key_error.matchee.keysend
Public Instance Methods
corrections()click to toggle source
# File ruby-3.1.2/lib/did_you_mean/spell_checkers/pattern_key_name_checker.rb, line 10defcorrections@corrections||=exact_matches.empty??SpellChecker.new(dictionary:@keys).correct(@key).map(&:inspect) :exact_matchesend
Private Instance Methods
exact_matches()click to toggle source
# File ruby-3.1.2/lib/did_you_mean/spell_checkers/pattern_key_name_checker.rb, line 16defexact_matches@exact_matches||=@keys.select { |word|@key==word.to_s }.map(&:inspect)
end