Sha256: dfab98374b11b918c2584831d41fd8b632c380fc3edc1432bb2de2c5c71c65b9

Contents?: true

Size: 310 Bytes

Versions: 5

Compression:

Stored size: 310 Bytes

Contents

require "did_you_mean/spell_checker"

module DidYouMean
  class KeyErrorChecker
    def initialize(key_error)
      @key = key_error.key
      @keys = key_error.receiver.keys
    end

    def corrections
      @corrections ||= SpellChecker.new(dictionary: @keys).correct(@key).map(&:inspect)
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
did_you_mean-1.3.1 lib/did_you_mean/spell_checkers/key_error_checker.rb
did_you_mean-1.2.2 lib/did_you_mean/spell_checkers/key_error_checker.rb
did_you_mean-1.3.0 lib/did_you_mean/spell_checkers/key_error_checker.rb
did_you_mean-1.2.1 lib/did_you_mean/spell_checkers/key_error_checker.rb
did_you_mean-1.2.0 lib/did_you_mean/spell_checkers/key_error_checker.rb