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.

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.



46290
46291
46292
46293
46294
46295
46296
46297
# File 'lib/ovirtsdk4/types.rb', line 46290

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.



46302
46303
46304
46305
46306
46307
46308
46309
# File 'lib/ovirtsdk4/types.rb', line 46302

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.



46099
46100
46101
# File 'lib/ovirtsdk4/types.rb', line 46099

def comment
  @comment
end

#comment=(value) ⇒ Object

Sets the value of the comment attribute.



46108
46109
46110
# File 'lib/ovirtsdk4/types.rb', line 46108

def comment=(value)
  @comment = value
end

#core_idInteger

Returns the value of the core_id attribute.



46117
46118
46119
# File 'lib/ovirtsdk4/types.rb', line 46117

def core_id
  @core_id
end

#core_id=(value) ⇒ Object

Sets the value of the core_id attribute.



46126
46127
46128
# File 'lib/ovirtsdk4/types.rb', line 46126

def core_id=(value)
  @core_id = value
end

#cpu_idInteger

Returns the value of the cpu_id attribute.



46135
46136
46137
# File 'lib/ovirtsdk4/types.rb', line 46135

def cpu_id
  @cpu_id
end

#cpu_id=(value) ⇒ Object

Sets the value of the cpu_id attribute.



46144
46145
46146
# File 'lib/ovirtsdk4/types.rb', line 46144

def cpu_id=(value)
  @cpu_id = value
end

#descriptionString

Returns the value of the description attribute.



46153
46154
46155
# File 'lib/ovirtsdk4/types.rb', line 46153

def description
  @description
end

#description=(value) ⇒ Object

Sets the value of the description attribute.



46162
46163
46164
# File 'lib/ovirtsdk4/types.rb', line 46162

def description=(value)
  @description = value
end

#hashObject

Generates a hash value for this object.



46314
46315
46316
46317
46318
46319
46320
46321
# File 'lib/ovirtsdk4/types.rb', line 46314

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.



46171
46172
46173
# File 'lib/ovirtsdk4/types.rb', line 46171

def id
  @id
end

#id=(value) ⇒ Object

Sets the value of the id attribute.



46180
46181
46182
# File 'lib/ovirtsdk4/types.rb', line 46180

def id=(value)
  @id = value
end

#nameString

Returns the value of the name attribute.



46189
46190
46191
# File 'lib/ovirtsdk4/types.rb', line 46189

def name
  @name
end

#name=(value) ⇒ Object

Sets the value of the name attribute.



46198
46199
46200
# File 'lib/ovirtsdk4/types.rb', line 46198

def name=(value)
  @name = value
end

#runs_vdsmBoolean

Returns the value of the runs_vdsm attribute.



46207
46208
46209
# File 'lib/ovirtsdk4/types.rb', line 46207

def runs_vdsm
  @runs_vdsm
end

#runs_vdsm=(value) ⇒ Object

Sets the value of the runs_vdsm attribute.



46216
46217
46218
# File 'lib/ovirtsdk4/types.rb', line 46216

def runs_vdsm=(value)
  @runs_vdsm = value
end

#socket_idInteger

Returns the value of the socket_id attribute.



46225
46226
46227
# File 'lib/ovirtsdk4/types.rb', line 46225

def socket_id
  @socket_id
end

#socket_id=(value) ⇒ Object

Sets the value of the socket_id attribute.



46234
46235
46236
# File 'lib/ovirtsdk4/types.rb', line 46234

def socket_id=(value)
  @socket_id = value
end

#vmsArray<Vm>

Returns the value of the vms attribute.



46243
46244
46245
# File 'lib/ovirtsdk4/types.rb', line 46243

def vms
  @vms
end

#vms=(list) ⇒ Object

Sets the value of the vms attribute.



46252
46253
46254
46255
46256
46257
46258
46259
46260
46261
46262
# File 'lib/ovirtsdk4/types.rb', line 46252

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