Sha256: c316ea686d41766938632fa64a2ba9e2f9c3e8eda5cbfaf826d75474e7b50f58
Contents?: true
Size: 435 Bytes
Versions: 2
Compression:
Stored size: 435 Bytes
Contents
module DidYouMean class Formatter def initialize(suggestions = []) @suggestions = suggestions end def to_s return "" if @suggestions.empty? output = "\n\n" output << " Did you mean? #{format(@suggestions.first)}\n" output << @suggestions.drop(1).map{|word| "#{' ' * 18}#{format(word)}\n" }.join output << " " # for rspec end def format(name) name end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
did_you_mean-0.10.0-java | lib/did_you_mean/formatter.rb |
did_you_mean-0.10.0 | lib/did_you_mean/formatter.rb |