Sha256: be313cb33e82e418ba5c768c959d73dfd9d5bac6f4edde570b5872a20a6d4173

Contents?: true

Size: 216 Bytes

Versions: 5

Compression:

Stored size: 216 Bytes

Contents

module TypoGen
  class SwapLetter
    def self.create(word)
      (word.size-1).times.map do |i|
        temp = word.dup

        temp[i], temp[i+1] = temp[i+1], temp[i]
        temp
      end.uniq
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
typogen-0.2.2 lib/typogen/swap_letter.rb
typogen-0.2.1 lib/typogen/swap_letter.rb
typogen-0.2.0 lib/typogen/swap_letter.rb
typogen-0.1.1 lib/typogen/swap_letter.rb
typogen-0.1.0 lib/typogen/swap_letter.rb