Class: OvirtSDK4::CpuTune

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 = {}) ⇒ CpuTune

Creates a new instance of the OvirtSDK4::CpuTune 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):

  • :vcpu_pins (Array<VcpuPin>, Array<Hash>)

    The values of attribute vcpu_pins.


2590
2591
2592
2593
# File 'lib/ovirtsdk4/types.rb', line 2590

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

Instance Method Details

#==(other) ⇒ Object

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


2598
2599
2600
2601
# File 'lib/ovirtsdk4/types.rb', line 2598

def ==(other)
  super &&
  @vcpu_pins == other.vcpu_pins
end

#hashObject

Generates a hash value for this object.


2606
2607
2608
2609
# File 'lib/ovirtsdk4/types.rb', line 2606

def hash
  super +
  @vcpu_pins.hash
end

#vcpu_pinsArray<VcpuPin>

Returns the value of the vcpu_pins attribute.

Returns:


2559
2560
2561
# File 'lib/ovirtsdk4/types.rb', line 2559

def vcpu_pins
  @vcpu_pins
end

#vcpu_pins=(list) ⇒ Object

Sets the value of the vcpu_pins attribute.

Parameters:


2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
# File 'lib/ovirtsdk4/types.rb', line 2568

def vcpu_pins=(list)
  if list.class == Array
    list = List.new(list)
    list.each_with_index do |value, index|
      if value.is_a?(Hash)
        list[index] = VcpuPin.new(value)
      end
    end
  end
  @vcpu_pins = list
end