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.



3420
3421
3422
3423
3424
# File 'lib/ovirtsdk4/types.rb', line 3420

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.



3429
3430
3431
3432
3433
# File 'lib/ovirtsdk4/types.rb', line 3429

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

#cpu_tuneCpuTune

Returns the value of the cpu_tune attribute.

Returns:



3363
3364
3365
# File 'lib/ovirtsdk4/types.rb', line 3363

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:



3376
3377
3378
3379
3380
3381
# File 'lib/ovirtsdk4/types.rb', line 3376

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.



3438
3439
3440
3441
3442
# File 'lib/ovirtsdk4/types.rb', line 3438

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

#topologyCpuTopology

Returns the value of the topology attribute.

Returns:



3388
3389
3390
# File 'lib/ovirtsdk4/types.rb', line 3388

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:



3401
3402
3403
3404
3405
3406
# File 'lib/ovirtsdk4/types.rb', line 3401

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