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 1831 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 1627 def architecture return @architecture end
Sets the value of the `architecture` attribute.
@param value [Architecture]
# File lib/ovirtsdk4/types.rb, line 1636 def architecture=(value) @architecture = value end
Returns the value of the `cores` attribute.
@return [Array<Core>]
# File lib/ovirtsdk4/types.rb, line 1645 def cores return @cores end
Sets the value of the `cores` attribute.
@param list [Array<Core>]
# File lib/ovirtsdk4/types.rb, line 1653 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 1670 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 1683 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 1695 def level return @level end
Sets the value of the `level` attribute.
@param value [Integer]
# File lib/ovirtsdk4/types.rb, line 1704 def level=(value) @level = value end
Returns the value of the `mode` attribute.
@return [CpuMode]
# File lib/ovirtsdk4/types.rb, line 1713 def mode return @mode end
Sets the value of the `mode` attribute.
@param value [CpuMode]
# File lib/ovirtsdk4/types.rb, line 1722 def mode=(value) @mode = value end
Returns the value of the `name` attribute.
@return [String]
# File lib/ovirtsdk4/types.rb, line 1731 def name return @name end
Sets the value of the `name` attribute.
@param value [String]
# File lib/ovirtsdk4/types.rb, line 1740 def name=(value) @name = value end
Returns the value of the `speed` attribute.
@return [Fixnum]
# File lib/ovirtsdk4/types.rb, line 1749 def speed return @speed end
Sets the value of the `speed` attribute.
@param value [Fixnum]
# File lib/ovirtsdk4/types.rb, line 1758 def speed=(value) @speed = value end
Returns the value of the `topology` attribute.
@return [CpuTopology]
# File lib/ovirtsdk4/types.rb, line 1767 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 1780 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 1792 def type return @type end
Sets the value of the `type` attribute.
@param value [String]
# File lib/ovirtsdk4/types.rb, line 1801 def type=(value) @type = value end