summaryrefslogtreecommitdiff
path: root/lib/did_you_mean/formatter.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/did_you_mean/formatter.rb')
-rw-r--r--lib/did_you_mean/formatter.rb11
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/did_you_mean/formatter.rb b/lib/did_you_mean/formatter.rb
index 01eb59100a..c43748f707 100644
--- a/lib/did_you_mean/formatter.rb
+++ b/lib/did_you_mean/formatter.rb
@@ -26,10 +26,19 @@ module DidYouMean
#
# # => nil
#
- def message_for(corrections)
+ def self.message_for(corrections)
corrections.empty? ? "" : "\nDid you mean? #{corrections.join("\n ")}"
end
+
+ def message_for(corrections)
+ warn "The instance method #message_for has been deprecated. Please use the class method " \
+ "DidYouMean::Formatter.message_for(...) instead."
+
+ self.class.message_for(corrections)
+ end
end
PlainFormatter = Formatter
+
+ deprecate_constant :PlainFormatter
end