Class: VagrantPlugins::ProviderLibvirt::Util::Xml

Inherits:
Object
  • Object
show all
Defined in:
lib/vagrant-libvirt/util/xml.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(xmlstr) ⇒ Xml

Returns a new instance of Xml.



11
12
13
# File 'lib/vagrant-libvirt/util/xml.rb', line 11

def initialize(xmlstr)
  @xml = compact_content(XmlSimple.xml_in(xmlstr, {'NormaliseSpace' => 2}))
end

Instance Attribute Details

#xmlObject (readonly)

Returns the value of attribute xml.



9
10
11
# File 'lib/vagrant-libvirt/util/xml.rb', line 9

def xml
  @xml
end

Instance Method Details

#==(other) ⇒ Object



19
20
21
# File 'lib/vagrant-libvirt/util/xml.rb', line 19

def ==(other)
  @xml == other.xml
end

#to_strObject



15
16
17
# File 'lib/vagrant-libvirt/util/xml.rb', line 15

def to_str
  XmlSimple.xml_out(@xml)
end