Sha256: dc4385df072e87f0a4fb44108f680699b3d26112b719db979fa4244e91cd256c

Contents?: true

Size: 319 Bytes

Versions: 7

Compression:

Stored size: 319 Bytes

Contents

# -*- frozen-string-literal: true -*-

module DidYouMean
  class Formatter
    def initialize(corrections = [])
      @corrections = corrections
    end

    def to_s
      return "" if @corrections.empty?

      output = "\nDid you mean?  ".dup
      output << @corrections.join("\n               ")
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
did_you_mean-1.0.4 lib/did_you_mean/formatter.rb
did_you_mean-1.0.3 lib/did_you_mean/formatter.rb
did_you_mean-1.0.2 lib/did_you_mean/formatter.rb
did_you_mean-1.0.1 lib/did_you_mean/formatter.rb
did_you_mean-1.0.0 lib/did_you_mean/formatter.rb
did_you_mean-1.0.0.rc1 lib/did_you_mean/formatter.rb
did_you_mean-1.0.0.beta3 lib/did_you_mean/formatter.rb