Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby-xml-mapper/basic_containers.rb

Class Method Summary collapse

Class Method Details

.new_from_xml_attr(attr) ⇒ Object



18
19
20
# File 'lib/ruby-xml-mapper/basic_containers.rb', line 18

def self.new_from_xml_attr attr
  new(attr.value.strip.gsub(/\s*[\r\n]\s*/, "\n"))
end

.new_from_xml_node(node) ⇒ Object



22
23
24
# File 'lib/ruby-xml-mapper/basic_containers.rb', line 22

def self.new_from_xml_node node
  new(node.content.strip.gsub(/\s*[\r\n]\s*/, "\n"))
end