class DidYouMean::PatternKeyNameChecker

Public Class Methods

new (no_matching_pattern_key_error)
# File lib/did_you_mean/spell_checkers/pattern_key_name_checker.rb, line 5
def initialize(no_matching_pattern_key_error)
  @key = no_matching_pattern_key_error.key
  @keys = no_matching_pattern_key_error.matchee.keys
end

Public Instance Methods

corrections ()
# File lib/did_you_mean/spell_checkers/pattern_key_name_checker.rb, line 10
def corrections
  @corrections ||= exact_matches.empty? ? SpellChecker.new(dictionary: @keys).correct(@key).map(&:inspect) : exact_matches
end