Class: Fixnum

Inherits:
Object show all
Defined in:
lib/active_support/vendor/builder-2.1.2/builder/xchar.rb,
lib/active_support/core_ext/string/output_safety.rb

Overview

Enhance the Fixnum class with a XML escaped character conversion.

Constant Summary collapse

XChar =
Builder::XChar

Instance Method Summary collapse

Instance Method Details

#html_safe?Boolean



58
59
60
# File 'lib/active_support/core_ext/string/output_safety.rb', line 58

def html_safe?
  true
end

#xchrObject

XML escaped version of chr



93
94
95
96
97
98
99
100
# File 'lib/active_support/vendor/builder-2.1.2/builder/xchar.rb', line 93

def xchr
  n = XChar::CP1252[self] || self
  case n when *XChar::VALID
    XChar::PREDEFINED[n] or (n<128 ? n.chr : "&##{n};")
  else
    '*'
  end
end