Class: String

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

Overview

Add the sanitize! method to the String class

Instance Method Summary collapse

Instance Method Details

#sanitizeObject

Sanitize the String completely from memory. This is non-reversible.



9
10
11
12
13
14
# File 'lib/string.rb', line 9

def sanitize
  for i in 0...self.length
    self[i] = 0
  end
  self.delete!("\000")
end