Method: Fog::Compute::LibvirtUtil#xml_element

Defined in:
lib/fog/libvirt/models/compute/util/util.rb

#xml_element(xml, path, attribute = nil) ⇒ Object



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

def xml_element(xml, path, attribute=nil)
  xml = Nokogiri::XML(xml)
  attribute.nil? ? (xml/path).first.text : (xml/path).first[attribute.to_sym]
end