aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails/command/spellchecker.rb
blob: 154358cd45b83b834785a836892ffd47270c57d7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
# frozen_string_literal: true

module Rails
  module Command
    module Spellchecker # :nodoc:
      def self.suggest(word, from:)
        DidYouMean::SpellChecker.new(dictionary: from.map(&:to_s)).correct(word).first
      end
    end
  end
end