Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/structformatter.rb
Instance Method Summary collapse
Instance Method Details
#xml_escape ⇒ Object
7 8 9 |
# File 'lib/structformatter.rb', line 7 def xml_escape self.gsub(/&/,"&").gsub(/"/, """).gsub(/'/, "&apros;").gsub(/</,"<").gsub(/>/,">") end |
#xml_escape! ⇒ Object
10 11 12 13 14 15 16 |
# File 'lib/structformatter.rb', line 10 def xml_escape! self.gsub!(/&/,"&") self.gsub!(/"/, """) self.gsub!(/'/, "&apros;") self.gsub!(/</,"<") self.gsub!(/>/,">") end |