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 [Fixnum] :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`.
# File lib/ovirtsdk4/types.rb, line 1837 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
Returns the value of the `architecture` attribute.
@return [Architecture]
# File lib/ovirtsdk4/types.rb, line 1633 def architecture return @architecture end
Sets the value of the `architecture` attribute.
@param value [Architecture]
# File lib/ovirtsdk4/types.rb, line 1642 def architecture=(value) @architecture = value end
Returns the value of the `cores` attribute.
@return [Array<Core>]
# File lib/ovirtsdk4/types.rb, line 1651 def cores return @cores end
Sets the value of the `cores` attribute.
@param list [Array<Core>]
# File lib/ovirtsdk4/types.rb, line 1659 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
Returns the value of the `cpu_tune` attribute.
@return [CpuTune]
# File lib/ovirtsdk4/types.rb, line 1676 def cpu_tune return @cpu_tune end
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 1689 def cpu_tune=(value) if value.is_a?(Hash) value = CpuTune.new(value) end @cpu_tune = value end
Returns the value of the `level` attribute.
@return [Integer]
# File lib/ovirtsdk4/types.rb, line 1701 def level return @level end
Sets the value of the `level` attribute.
@param value [Integer]
# File lib/ovirtsdk4/types.rb, line 1710 def level=(value) @level = value end
Returns the value of the `mode` attribute.
@return [CpuMode]
# File lib/ovirtsdk4/types.rb, line 1719 def mode return @mode end
Sets the value of the `mode` attribute.
@param value [CpuMode]
# File lib/ovirtsdk4/types.rb, line 1728 def mode=(value) @mode = value end
Returns the value of the `name` attribute.
@return [String]
# File lib/ovirtsdk4/types.rb, line 1737 def name return @name end
Sets the value of the `name` attribute.
@param value [String]
# File lib/ovirtsdk4/types.rb, line 1746 def name=(value) @name = value end
Returns the value of the `speed` attribute.
@return [Fixnum]
# File lib/ovirtsdk4/types.rb, line 1755 def speed return @speed end
Sets the value of the `speed` attribute.
@param value [Fixnum]
# File lib/ovirtsdk4/types.rb, line 1764 def speed=(value) @speed = value end
Returns the value of the `topology` attribute.
@return [CpuTopology]
# File lib/ovirtsdk4/types.rb, line 1773 def topology return @topology end
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 1786 def topology=(value) if value.is_a?(Hash) value = CpuTopology.new(value) end @topology = value end
Returns the value of the `type` attribute.
@return [String]
# File lib/ovirtsdk4/types.rb, line 1798 def type return @type end
Sets the value of the `type` attribute.
@param value [String]
# File lib/ovirtsdk4/types.rb, line 1807 def type=(value) @type = value end