Module: Fog::Compute::LibvirtUtil

Included in:
Fog::Compute::Libvirt::Network, Fog::Compute::Libvirt::Server, Fog::Compute::Libvirt::Volume
Defined in:
lib/fog/libvirt/models/compute/uri.rb,
lib/fog/libvirt/models/compute/util.rb

Defined Under Namespace

Classes: ErbBinding, URI

Instance Method Summary collapse

Instance Method Details

#document(path, attribute = nil) ⇒ Object

finds a value from xml



10
11
12
13
14
# File 'lib/fog/libvirt/models/compute/util.rb', line 10

def document path, attribute=nil
  return nil if new?
  xml = REXML::Document.new(self.xml)
  attribute.nil? ? xml.elements[path].text : xml.elements[path].attributes[attribute]
end