Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/thanoscase/string.rb

Instance Method Summary collapse

Instance Method Details

#thanoscaseObject



12
13
14
# File 'lib/thanoscase/string.rb', line 12

def thanoscase
  dup.thanoscase!
end

#thanoscase!Object



4
5
6
7
8
9
10
# File 'lib/thanoscase/string.rb', line 4

def thanoscase!
  return self if empty?

  half_universe = length / 2
  half_universe.times { slice!(rand(length)) }
  self
end