Class: ROXML::XMLTextRef
Overview
Interal class representing XML content text binding
In context:
<element attribute="XMLAttributeRef">
XMLTextRef
</element>
Direct Known Subclasses
Instance Attribute Summary
Attributes inherited from XMLRef
Instance Method Summary collapse
-
#update_xml(xml, value) ⇒ Object
Updates the text in the given xml block to the value provided.
Methods inherited from XMLRef
#blocks, #initialize, #name, #to_xml, #value_in, #xpath_name
Constructor Details
This class inherits a constructor from ROXML::XMLRef
Instance Method Details
#update_xml(xml, value) ⇒ Object
Updates the text in the given xml block to the value provided.
172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 |
# File 'lib/roxml/xml/references.rb', line 172 def update_xml(xml, value) wrap(xml).tap do |xml| if content? add(xml, value) elsif name? xml.name = value elsif array? value.each do |v| add(XML.add_node(xml, name), v) end else add(XML.add_node(xml, name), value) end end end |