Class: TypoGen::SwapLetter
- Inherits:
-
Object
- Object
- TypoGen::SwapLetter
- Defined in:
- lib/typogen/swap_letter.rb
Class Method Summary collapse
Class Method Details
.create(word) ⇒ Object
3 4 5 6 7 8 9 10 |
# File 'lib/typogen/swap_letter.rb', line 3 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 |