class Numeric

Public Class Methods

load_from_xml(xml, options={:mapping=>:_default}) click to toggle source
# File lib/xml/mapping/core_classes_mapping.rb, line 17
def self.load_from_xml(xml, options={:mapping=>:_default})
  begin
    Integer(xml.text)
  rescue ArgumentError
    Float(xml.text)
  end
end

Public Instance Methods

fill_into_xml(xml, options={:mapping=>:_default}) click to toggle source
# File lib/xml/mapping/core_classes_mapping.rb, line 25
def fill_into_xml(xml, options={:mapping=>:_default})
  xml.text = self.to_s
end
text() click to toggle source
# File lib/xml/mapping/core_classes_mapping.rb, line 29
def text
  self.to_s
end