Class: String

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

Instance Method Summary collapse

Instance Method Details

#escape_single_quotesObject



2
3
4
# File 'lib/trust_html/string_ext.rb', line 2

def escape_single_quotes
  self.gsub(/'/, "\\\\'")
end

#remove_nonprintableObject



6
7
8
# File 'lib/trust_html/string_ext.rb', line 6

def remove_nonprintable
  self.scan(/[[:print:]]/).join
end