Class: Objectify::ElementParser
- Defined in:
- lib/objectify_xml/element_parser.rb
Direct Known Subclasses
Constant Summary
Constants inherited from Xml
Instance Attribute Summary
Attributes inherited from Xml
Instance Method Summary collapse
-
#primary_xml_element(xml) ⇒ Object
Stores the xml element’s attribute values, inner_text and inner_html if they are defined.
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
Stores the xml element’s attribute values, inner_text and inner_html if they are defined.
Attributes can be defined either with the attribute dsl method or by defining a name= method in the object.
8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/objectify_xml/element_parser.rb', line 8 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 |