Class Fixnum
In: vendor/rails/activesupport/lib/active_support/vendor/builder-2.1.2/builder/xchar.rb
vendor/rails/activesupport/lib/active_support/core_ext/string/output_safety.rb
Parent: Object

Enhance the Fixnum class with a XML escaped character conversion.

Methods

html_safe?   xchr  

Constants

XChar = Builder::XChar if ! defined?(XChar)

Public Instance methods

[Source]

    # File vendor/rails/activesupport/lib/active_support/core_ext/string/output_safety.rb, line 74
74:   def html_safe?
75:     true
76:   end

XML escaped version of chr

[Source]

     # File vendor/rails/activesupport/lib/active_support/vendor/builder-2.1.2/builder/xchar.rb, line 93
 93:   def xchr
 94:     n = XChar::CP1252[self] || self
 95:     case n when *XChar::VALID
 96:       XChar::PREDEFINED[n] or (n<128 ? n.chr : "&##{n};")
 97:     else
 98:       '*'
 99:     end
100:   end

[Validate]