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`.
# File lib/ovirtsdk4/types.rb, line 2275 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 `true` if `self` and `other` have the same attributes and values.
# File lib/ovirtsdk4/types.rb, line 2291 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
Returns the value of the `architecture` attribute.
@return [Architecture]
# File lib/ovirtsdk4/types.rb, line 2070 def architecture @architecture end
Sets the value of the `architecture` attribute.
@param value [Architecture]
# File lib/ovirtsdk4/types.rb, line 2079 def architecture=(value) @architecture = value end
Returns the value of the `cores` attribute.
@return [Array<Core>]
# File lib/ovirtsdk4/types.rb, line 2088 def cores @cores end
Sets the value of the `cores` attribute.
@param list [Array<Core>]
# File lib/ovirtsdk4/types.rb, line 2097 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 2114 def cpu_tune @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 2127 def cpu_tune=(value) if value.is_a?(Hash) value = CpuTune.new(value) end @cpu_tune = value end
Generates a hash value for this object.
# File lib/ovirtsdk4/types.rb, line 2307 def hash super + @architecture.hash + @cores.hash + @cpu_tune.hash + @level.hash + @mode.hash + @name.hash + @speed.hash + @topology.hash + @type.hash end
Returns the value of the `level` attribute.
@return [Integer]
# File lib/ovirtsdk4/types.rb, line 2139 def level @level end
Sets the value of the `level` attribute.
@param value [Integer]
# File lib/ovirtsdk4/types.rb, line 2148 def level=(value) @level = value end
Returns the value of the `mode` attribute.
@return [CpuMode]
# File lib/ovirtsdk4/types.rb, line 2157 def mode @mode end
Sets the value of the `mode` attribute.
@param value [CpuMode]
# File lib/ovirtsdk4/types.rb, line 2166 def mode=(value) @mode = value end
Returns the value of the `name` attribute.
@return [String]
# File lib/ovirtsdk4/types.rb, line 2175 def name @name end
Sets the value of the `name` attribute.
@param value [String]
# File lib/ovirtsdk4/types.rb, line 2184 def name=(value) @name = value end
Returns the value of the `speed` attribute.
@return [Float]
# File lib/ovirtsdk4/types.rb, line 2193 def speed @speed end
Sets the value of the `speed` attribute.
@param value [Float]
# File lib/ovirtsdk4/types.rb, line 2202 def speed=(value) @speed = value end
Returns the value of the `topology` attribute.
@return [CpuTopology]
# File lib/ovirtsdk4/types.rb, line 2211 def topology @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 2224 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 2236 def type @type end
Sets the value of the `type` attribute.
@param value [String]
# File lib/ovirtsdk4/types.rb, line 2245 def type=(value) @type = value end