Class: OvirtSDK4::HostCpuUnit

Inherits:
Identified 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 = {}) ⇒ HostCpuUnit

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

  • :comment (String)

    The value of attribute comment.

  • :core_id (Integer)

    The value of attribute core_id.

  • :cpu_id (Integer)

    The value of attribute cpu_id.

  • :description (String)

    The value of attribute description.

  • :id (String)

    The value of attribute id.

  • :name (String)

    The value of attribute name.

  • :runs_vdsm (Boolean)

    The value of attribute runs_vdsm.

  • :socket_id (Integer)

    The value of attribute socket_id.

  • :vms (Array<Vm>, Array<Hash>)

    The values of attribute vms.



45997
45998
45999
46000
46001
46002
46003
46004
# File 'lib/ovirtsdk4/types.rb', line 45997

def initialize(opts = {})
  super(opts)
  self.core_id = opts[:core_id]
  self.cpu_id = opts[:cpu_id]
  self.runs_vdsm = opts[:runs_vdsm]
  self.socket_id = opts[:socket_id]
  self.vms = opts[:vms]
end

Instance Method Details

#==(other) ⇒ Object

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



46009
46010
46011
46012
46013
46014
46015
46016
# File 'lib/ovirtsdk4/types.rb', line 46009

def ==(other)
  super &&
  @core_id == other.core_id &&
  @cpu_id == other.cpu_id &&
  @runs_vdsm == other.runs_vdsm &&
  @socket_id == other.socket_id &&
  @vms == other.vms
end

#commentString

Returns the value of the comment attribute.

Returns:

  • (String)


45806
45807
45808
# File 'lib/ovirtsdk4/types.rb', line 45806

def comment
  @comment
end

#comment=(value) ⇒ Object

Sets the value of the comment attribute.

Parameters:

  • value (String)


45815
45816
45817
# File 'lib/ovirtsdk4/types.rb', line 45815

def comment=(value)
  @comment = value
end

#core_idInteger

Returns the value of the core_id attribute.

Returns:

  • (Integer)


45824
45825
45826
# File 'lib/ovirtsdk4/types.rb', line 45824

def core_id
  @core_id
end

#core_id=(value) ⇒ Object

Sets the value of the core_id attribute.

Parameters:

  • value (Integer)


45833
45834
45835
# File 'lib/ovirtsdk4/types.rb', line 45833

def core_id=(value)
  @core_id = value
end

#cpu_idInteger

Returns the value of the cpu_id attribute.

Returns:

  • (Integer)


45842
45843
45844
# File 'lib/ovirtsdk4/types.rb', line 45842

def cpu_id
  @cpu_id
end

#cpu_id=(value) ⇒ Object

Sets the value of the cpu_id attribute.

Parameters:

  • value (Integer)


45851
45852
45853
# File 'lib/ovirtsdk4/types.rb', line 45851

def cpu_id=(value)
  @cpu_id = value
end

#descriptionString

Returns the value of the description attribute.

Returns:

  • (String)


45860
45861
45862
# File 'lib/ovirtsdk4/types.rb', line 45860

def description
  @description
end

#description=(value) ⇒ Object

Sets the value of the description attribute.

Parameters:

  • value (String)


45869
45870
45871
# File 'lib/ovirtsdk4/types.rb', line 45869

def description=(value)
  @description = value
end

#hashObject

Generates a hash value for this object.



46021
46022
46023
46024
46025
46026
46027
46028
# File 'lib/ovirtsdk4/types.rb', line 46021

def hash
  super +
  @core_id.hash +
  @cpu_id.hash +
  @runs_vdsm.hash +
  @socket_id.hash +
  @vms.hash
end

#idString

Returns the value of the id attribute.

Returns:

  • (String)


45878
45879
45880
# File 'lib/ovirtsdk4/types.rb', line 45878

def id
  @id
end

#id=(value) ⇒ Object

Sets the value of the id attribute.

Parameters:

  • value (String)


45887
45888
45889
# File 'lib/ovirtsdk4/types.rb', line 45887

def id=(value)
  @id = value
end

#nameString

Returns the value of the name attribute.

Returns:

  • (String)


45896
45897
45898
# File 'lib/ovirtsdk4/types.rb', line 45896

def name
  @name
end

#name=(value) ⇒ Object

Sets the value of the name attribute.

Parameters:

  • value (String)


45905
45906
45907
# File 'lib/ovirtsdk4/types.rb', line 45905

def name=(value)
  @name = value
end

#runs_vdsmBoolean

Returns the value of the runs_vdsm attribute.

Returns:

  • (Boolean)


45914
45915
45916
# File 'lib/ovirtsdk4/types.rb', line 45914

def runs_vdsm
  @runs_vdsm
end

#runs_vdsm=(value) ⇒ Object

Sets the value of the runs_vdsm attribute.

Parameters:

  • value (Boolean)


45923
45924
45925
# File 'lib/ovirtsdk4/types.rb', line 45923

def runs_vdsm=(value)
  @runs_vdsm = value
end

#socket_idInteger

Returns the value of the socket_id attribute.

Returns:

  • (Integer)


45932
45933
45934
# File 'lib/ovirtsdk4/types.rb', line 45932

def socket_id
  @socket_id
end

#socket_id=(value) ⇒ Object

Sets the value of the socket_id attribute.

Parameters:

  • value (Integer)


45941
45942
45943
# File 'lib/ovirtsdk4/types.rb', line 45941

def socket_id=(value)
  @socket_id = value
end

#vmsArray<Vm>

Returns the value of the vms attribute.

Returns:

  • (Array<Vm>)


45950
45951
45952
# File 'lib/ovirtsdk4/types.rb', line 45950

def vms
  @vms
end

#vms=(list) ⇒ Object

Sets the value of the vms attribute.

Parameters:

  • list (Array<Vm>)


45959
45960
45961
45962
45963
45964
45965
45966
45967
45968
45969
# File 'lib/ovirtsdk4/types.rb', line 45959

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