Class: Objectify::ElementParser

Inherits:
Xml
  • Object
show all
Defined in:
lib/objectify_xml/element_parser.rb

Constant Summary

Constants inherited from Xml

Xml::VERSION

Instance Attribute Summary

Attributes inherited from Xml

#attributes, #parent

Instance Method Summary collapse

Methods inherited from Xml

first_element, inherited, #initialize, #inspect, #pretty_print

Constructor Details

This class inherits a constructor from Objectify::Xml

Instance Method Details

#primary_xml_element(xml) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/objectify_xml/element_parser.rb', line 3

def primary_xml_element(xml)
  xml.attributes.keys.each do |name|
    method = "#{ name }="
    if respond_to? method
      send(method, xml_text_to_value(xml[name]))
    end
  end
  if respond_to? :inner_html=
    self.inner_html = xml.inner_html
  end
  if respond_to? :inner_text=
    self.inner_text = xml.inner_text
  end
end