Class: OpenNebula::XMLPool
- Inherits:
-
XMLElement
- Object
- XMLElement
- OpenNebula::XMLPool
- Defined in:
- OpenNebula/XMLUtils.rb
Overview
The XMLUtilsPool module provides an abstraction of the underlying XML parser engine. It provides XML-related methods for the Pools
Direct Known Subclasses
Instance Method Summary (collapse)
-
- (Object) each_element(block)
Executes the given block for each element of the Pool
block
Block.
-
- (XMLPool) initialize(xml = nil)
constructor
A new instance of XMLPool.
Methods inherited from XMLElement
#[], #attr, build_xml, #each, #each_xpath, #has_elements?, #initialize_xml, #name, #retrieve_elements, #template_like_str, #template_str, #text, #to_hash, #to_xml
Constructor Details
- (XMLPool) initialize(xml = nil)
A new instance of XMLPool
316 317 318 |
# File 'OpenNebula/XMLUtils.rb', line 316 def initialize(xml=nil) super(xml) end |
Instance Method Details
- (Object) each_element(block)
Executes the given block for each element of the Pool
block |
Block |
322 323 324 325 326 327 328 329 330 331 332 333 334 |
# File 'OpenNebula/XMLUtils.rb', line 322 def each_element(block) if NOKOGIRI @xml.xpath( "#{@element_name}").each {|pelem| block.call self.factory(pelem) } else @xml.elements.each( "#{@element_name}") {|pelem| block.call self.factory(pelem) } end end |