Class: String

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

Overview

TODO: Double check .strip - is it needed actually

Class Method Summary collapse

Class Method Details

.new_from_xml_attr(attr) ⇒ Object



20
21
22
# File 'lib/ruby-xml-mapper/basic_containers.rb', line 20

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

.new_from_xml_node(node) ⇒ Object



24
25
26
# File 'lib/ruby-xml-mapper/basic_containers.rb', line 24

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