Class: Fixnum

Inherits:
Object
  • Object
show all
Defined in:
lib/rbook/onix/xchar.rb

Instance Method Summary collapse

Instance Method Details

#xchrObject

xml escaped version of chr



47
48
49
50
51
# File 'lib/rbook/onix/xchar.rb', line 47

def xchr
  n = ::XChar::CP1252[self] || self
  n = 42 unless ::XChar::VALID.find {|range| range.include? n}
  ::XChar::PREDEFINED[n] or (n<128 ? n.chr : "&##{n};")
end