Class: OvirtSDK4::DynamicCpu

Inherits:
Struct
  • Object
show all
Defined in:
lib/ovirtsdk4/types.rb,
lib/ovirtsdk4/types.rb

Instance Method Summary collapse

Methods included from Type

#dig, #href, #href=

Constructor Details

#initialize(opts = {}) ⇒ DynamicCpu

Creates a new instance of the OvirtSDK4::DynamicCpu class.

Parameters:

  • opts (Hash) (defaults to: {})

    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.

Options Hash (opts):

  • :cpu_tune (CpuTune, Hash)

    The value of attribute cpu_tune.

  • :topology (CpuTopology, Hash)

    The value of attribute topology.



3476
3477
3478
3479
3480
# File 'lib/ovirtsdk4/types.rb', line 3476

def initialize(opts = {})
  super(opts)
  self.cpu_tune = opts[:cpu_tune]
  self.topology = opts[:topology]
end

Instance Method Details

#==(other) ⇒ Object

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



3485
3486
3487
3488
3489
# File 'lib/ovirtsdk4/types.rb', line 3485

def ==(other)
  super &&
  @cpu_tune == other.cpu_tune &&
  @topology == other.topology
end

#cpu_tuneCpuTune

Returns the value of the cpu_tune attribute.

Returns:



3419
3420
3421
# File 'lib/ovirtsdk4/types.rb', line 3419

def cpu_tune
  @cpu_tune
end

#cpu_tune=(value) ⇒ Object

Sets the value of the cpu_tune attribute.

The value parameter can be an instance of 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.

Parameters:



3432
3433
3434
3435
3436
3437
# File 'lib/ovirtsdk4/types.rb', line 3432

def cpu_tune=(value)
  if value.is_a?(Hash)
    value = CpuTune.new(value)
  end
  @cpu_tune = value
end

#hashObject

Generates a hash value for this object.



3494
3495
3496
3497
3498
# File 'lib/ovirtsdk4/types.rb', line 3494

def hash
  super +
  @cpu_tune.hash +
  @topology.hash
end

#topologyCpuTopology

Returns the value of the topology attribute.

Returns:



3444
3445
3446
# File 'lib/ovirtsdk4/types.rb', line 3444

def topology
  @topology
end

#topology=(value) ⇒ Object

Sets the value of the topology attribute.

The value parameter can be an instance of 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.

Parameters:



3457
3458
3459
3460
3461
3462
# File 'lib/ovirtsdk4/types.rb', line 3457

def topology=(value)
  if value.is_a?(Hash)
    value = CpuTopology.new(value)
  end
  @topology = value
end