class OvirtSDK4::Cpu
Public Class Methods
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`.
OvirtSDK4::Struct::new
# File lib/ovirtsdk4/types.rb, line 2406 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
Returns `true` if `self` and `other` have the same attributes and values.
# File lib/ovirtsdk4/types.rb, line 2422 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 2201 def architecture @architecture end
Sets the value of the `architecture` attribute.
@param value [Architecture]
# File lib/ovirtsdk4/types.rb, line 2210 def architecture=(value) @architecture = value end
Returns the value of the `cores` attribute.
@return [Array<Core>]
# File lib/ovirtsdk4/types.rb, line 2219 def cores @cores end
Sets the value of the `cores` attribute.
@param list [Array<Core>]
# File lib/ovirtsdk4/types.rb, line 2228 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 2245 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 2258 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.
OvirtSDK4::Struct#hash
# File lib/ovirtsdk4/types.rb, line 2438 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 2270 def level @level end
Sets the value of the `level` attribute.
@param value [Integer]
# File lib/ovirtsdk4/types.rb, line 2279 def level=(value) @level = value end
Returns the value of the `mode` attribute.
@return [CpuMode]
# File lib/ovirtsdk4/types.rb, line 2288 def mode @mode end
Sets the value of the `mode` attribute.
@param value [CpuMode]
# File lib/ovirtsdk4/types.rb, line 2297 def mode=(value) @mode = value end
Returns the value of the `name` attribute.
@return [String]
# File lib/ovirtsdk4/types.rb, line 2306 def name @name end
Sets the value of the `name` attribute.
@param value [String]
# File lib/ovirtsdk4/types.rb, line 2315 def name=(value) @name = value end
Returns the value of the `speed` attribute.
@return [Float]
# File lib/ovirtsdk4/types.rb, line 2324 def speed @speed end
Sets the value of the `speed` attribute.
@param value [Float]
# File lib/ovirtsdk4/types.rb, line 2333 def speed=(value) @speed = value end
Returns the value of the `topology` attribute.
@return [CpuTopology]
# File lib/ovirtsdk4/types.rb, line 2342 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 2355 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 2367 def type @type end
Sets the value of the `type` attribute.
@param value [String]
# File lib/ovirtsdk4/types.rb, line 2376 def type=(value) @type = value end