class OvirtSDK4::Cpu

Public Class Methods

new(opts = {}) click to toggle source

Creates a new instance of the {Cpu} class.

@param opts [Hash] A hash containing the attributes of the object. The keys of the hash

should be symbols corresponding to the names of the attributes. The values of the hash
should be the values of the attributes.

@option opts [Architecture] :architecture The value of attribute `architecture`.

@option opts [Array<Core>, Array<Hash>] :cores The values of attribute `cores`.

@option opts [CpuTune, Hash] :cpu_tune The value of attribute `cpu_tune`.

@option opts [Integer] :level The value of attribute `level`.

@option opts [CpuMode] :mode The value of attribute `mode`.

@option opts [String] :name The value of attribute `name`.

@option opts [Float] :speed The value of attribute `speed`.

@option opts [CpuTopology, Hash] :topology The value of attribute `topology`.

@option opts [String] :type The value of attribute `type`.

Calls superclass method OvirtSDK4::Struct::new
# File lib/ovirtsdk4/types.rb, line 2424
def initialize(opts = {})
  super(opts)
  self.architecture = opts[:architecture]
  self.cores = opts[:cores]
  self.cpu_tune = opts[:cpu_tune]
  self.level = opts[:level]
  self.mode = opts[:mode]
  self.name = opts[:name]
  self.speed = opts[:speed]
  self.topology = opts[:topology]
  self.type = opts[:type]
end

Public Instance Methods

==(other) click to toggle source

Returns `true` if `self` and `other` have the same attributes and values.

Calls superclass method OvirtSDK4::Struct#==
# File lib/ovirtsdk4/types.rb, line 2440
def ==(other)
  super &&
  @architecture == other.architecture &&
  @cores == other.cores &&
  @cpu_tune == other.cpu_tune &&
  @level == other.level &&
  @mode == other.mode &&
  @name == other.name &&
  @speed == other.speed &&
  @topology == other.topology &&
  @type == other.type
end
architecture() click to toggle source

Returns the value of the `architecture` attribute.

@return [Architecture]

# File lib/ovirtsdk4/types.rb, line 2219
def architecture
  @architecture
end
architecture=(value) click to toggle source

Sets the value of the `architecture` attribute.

@param value [Architecture]

# File lib/ovirtsdk4/types.rb, line 2228
def architecture=(value)
  @architecture = value
end
cores() click to toggle source

Returns the value of the `cores` attribute.

@return [Array<Core>]

# File lib/ovirtsdk4/types.rb, line 2237
def cores
  @cores
end
cores=(list) click to toggle source

Sets the value of the `cores` attribute.

@param list [Array<Core>]

# File lib/ovirtsdk4/types.rb, line 2246
def cores=(list)
  if list.class == Array
    list = List.new(list)
    list.each_with_index do |value, index|
      if value.is_a?(Hash)
        list[index] = Core.new(value)
      end
    end
  end
  @cores = list
end
cpu_tune() click to toggle source

Returns the value of the `cpu_tune` attribute.

@return [CpuTune]

# File lib/ovirtsdk4/types.rb, line 2263
def cpu_tune
  @cpu_tune
end
cpu_tune=(value) click to toggle source

Sets the value of the `cpu_tune` attribute.

@param value [CpuTune, Hash]

The `value` parameter can be an instance of {OvirtSDK4::CpuTune} or a hash. If it is a hash then a new instance will be created passing the hash as the `opts` parameter to the constructor.

# File lib/ovirtsdk4/types.rb, line 2276
def cpu_tune=(value)
  if value.is_a?(Hash)
    value = CpuTune.new(value)
  end
  @cpu_tune = value
end
hash() click to toggle source

Generates a hash value for this object.

Calls superclass method OvirtSDK4::Struct#hash
# File lib/ovirtsdk4/types.rb, line 2456
def hash
  super +
  @architecture.hash +
  @cores.hash +
  @cpu_tune.hash +
  @level.hash +
  @mode.hash +
  @name.hash +
  @speed.hash +
  @topology.hash +
  @type.hash
end
level() click to toggle source

Returns the value of the `level` attribute.

@return [Integer]

# File lib/ovirtsdk4/types.rb, line 2288
def level
  @level
end
level=(value) click to toggle source

Sets the value of the `level` attribute.

@param value [Integer]

# File lib/ovirtsdk4/types.rb, line 2297
def level=(value)
  @level = value
end
mode() click to toggle source

Returns the value of the `mode` attribute.

@return [CpuMode]

# File lib/ovirtsdk4/types.rb, line 2306
def mode
  @mode
end
mode=(value) click to toggle source

Sets the value of the `mode` attribute.

@param value [CpuMode]

# File lib/ovirtsdk4/types.rb, line 2315
def mode=(value)
  @mode = value
end
name() click to toggle source

Returns the value of the `name` attribute.

@return [String]

# File lib/ovirtsdk4/types.rb, line 2324
def name
  @name
end
name=(value) click to toggle source

Sets the value of the `name` attribute.

@param value [String]

# File lib/ovirtsdk4/types.rb, line 2333
def name=(value)
  @name = value
end
speed() click to toggle source

Returns the value of the `speed` attribute.

@return [Float]

# File lib/ovirtsdk4/types.rb, line 2342
def speed
  @speed
end
speed=(value) click to toggle source

Sets the value of the `speed` attribute.

@param value [Float]

# File lib/ovirtsdk4/types.rb, line 2351
def speed=(value)
  @speed = value
end
topology() click to toggle source

Returns the value of the `topology` attribute.

@return [CpuTopology]

# File lib/ovirtsdk4/types.rb, line 2360
def topology
  @topology
end
topology=(value) click to toggle source

Sets the value of the `topology` attribute.

@param value [CpuTopology, Hash]

The `value` parameter can be an instance of {OvirtSDK4::CpuTopology} or a hash. If it is a hash then a new instance will be created passing the hash as the `opts` parameter to the constructor.

# File lib/ovirtsdk4/types.rb, line 2373
def topology=(value)
  if value.is_a?(Hash)
    value = CpuTopology.new(value)
  end
  @topology = value
end
type() click to toggle source

Returns the value of the `type` attribute.

@return [String]

# File lib/ovirtsdk4/types.rb, line 2385
def type
  @type
end
type=(value) click to toggle source

Sets the value of the `type` attribute.

@param value [String]

# File lib/ovirtsdk4/types.rb, line 2394
def type=(value)
  @type = value
end