Module: Tyop

Included in:
String
Defined in:
lib/tyop.rb

Constant Summary collapse

LOWERCASE_LETTERS =
('a'..'z').to_a
UPPERCASE_LETTERS =
('A'..'Z').to_a
LETTERS =
LOWERCASE_LETTERS + UPPERCASE_LETTERS

Instance Method Summary collapse

Instance Method Details

#typolize(count = 1) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/tyop.rb', line 6

def typolize(count=1)
  original = self.dup
  
  length = original.length
  
  count.times do
    a = rand(length)
  
    l = LETTERS.length
      
    original[a] = LETTERS[rand(l)]
  end
  
  original
end