Sha256: 38772791132916217bdf1e9ca1b8e06af2f0311ee91665f6e8dc76c68909d688

Contents?: true

Size: 831 Bytes

Versions: 20

Compression:

Stored size: 831 Bytes

Contents

module OVIRT
  class DataCenter < BaseObject
    attr_reader :description, :status, :local, :storage_type, :storage_format, :supported_versions, :version

    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)
      @description = (xml/'description').first.text rescue nil
      @status = (xml/'status').first.text.strip
      @local = parse_bool((xml/'local').first.text) rescue nil
      @storage_type = (xml/'storage_type').first.text rescue nil
      @storage_format = (xml/'storage_format').first.text rescue nil
      @supported_versions = (xml/'supported_versions').collect { |v|
        parse_version v
      }
      @version = parse_version xml rescue nil
    end
  end
 
end

Version data entries

20 entries across 18 versions & 2 rubygems

Version Path
rbovirt-0.1.7 lib/ovirt/datacenter.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.5.0/gems/rbovirt-0.1.6/lib/ovirt/datacenter.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.4.0/gems/rbovirt-0.1.6/lib/ovirt/datacenter.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.3.0/gems/rbovirt-0.1.6/lib/ovirt/datacenter.rb
rbovirt-0.1.6 lib/ovirt/datacenter.rb
rbovirt-0.1.5 lib/ovirt/datacenter.rb
rbovirt-0.1.4 lib/ovirt/datacenter.rb
rbovirt-0.1.3 lib/ovirt/datacenter.rb
rbovirt-0.1.2 lib/ovirt/datacenter.rb
rbovirt-0.0.38 lib/ovirt/datacenter.rb
rbovirt-0.1.1 lib/ovirt/datacenter.rb
rbovirt-0.0.37 lib/ovirt/datacenter.rb
rbovirt-0.0.36 lib/ovirt/datacenter.rb
rbovirt-0.1.0 lib/ovirt/datacenter.rb
rbovirt-0.0.35 lib/ovirt/datacenter.rb
rbovirt-0.0.34 lib/ovirt/datacenter.rb
rbovirt-0.0.33 lib/ovirt/datacenter.rb
rbovirt-0.0.32 lib/ovirt/datacenter.rb
rbovirt-0.0.31 lib/ovirt/datacenter.rb
rbovirt-0.0.30 lib/ovirt/datacenter.rb