module OVIRT class StorageDomain < BaseObject attr_reader :available, :used, :kind, :address, :path def initialize(client, xml) super(client, xml[:id], xml[:href], (xml/'name').first.text) parse_xml_attributes!(xml) self end private def parse_xml_attributes!(xml) @available = (xml/'available').first.text @used = (xml/'used').first.text @kind = (xml/'storage/type').first.text @address = ((xml/'storage/address').first.text rescue nil) @path = ((xml/'storage/path').first.text rescue nil) end end end