Class: OvirtSDK4::AffinityLabel

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

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

  • :description (String)

    The value of attribute description.

  • :has_implicit_affinity_group (Boolean)

    The value of attribute has_implicit_affinity_group.

  • :hosts (Array<Host>, Array<Hash>)

    The values of attribute hosts.

  • :id (String)

    The value of attribute id.

  • :name (String)

    The value of attribute name.

  • :read_only (Boolean)

    The value of attribute read_only.

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

    The values of attribute vms.


30495
30496
30497
30498
30499
30500
30501
# File 'lib/ovirtsdk4/types.rb', line 30495

def initialize(opts = {})
  super(opts)
  self.has_implicit_affinity_group = opts[:has_implicit_affinity_group]
  self.hosts = opts[:hosts]
  self.read_only = opts[:read_only]
  self.vms = opts[:vms]
end

Instance Method Details

#==(other) ⇒ Object

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


30506
30507
30508
30509
30510
30511
30512
# File 'lib/ovirtsdk4/types.rb', line 30506

def ==(other)
  super &&
  @has_implicit_affinity_group == other.has_implicit_affinity_group &&
  @hosts == other.hosts &&
  @read_only == other.read_only &&
  @vms == other.vms
end

#commentString

Returns the value of the comment attribute.

Returns:

  • (String)

30316
30317
30318
# File 'lib/ovirtsdk4/types.rb', line 30316

def comment
  @comment
end

#comment=(value) ⇒ Object

Sets the value of the comment attribute.

Parameters:

  • value (String)

30325
30326
30327
# File 'lib/ovirtsdk4/types.rb', line 30325

def comment=(value)
  @comment = value
end

#descriptionString

Returns the value of the description attribute.

Returns:

  • (String)

30334
30335
30336
# File 'lib/ovirtsdk4/types.rb', line 30334

def description
  @description
end

#description=(value) ⇒ Object

Sets the value of the description attribute.

Parameters:

  • value (String)

30343
30344
30345
# File 'lib/ovirtsdk4/types.rb', line 30343

def description=(value)
  @description = value
end

#has_implicit_affinity_groupBoolean

Returns the value of the has_implicit_affinity_group attribute.

Returns:

  • (Boolean)

30352
30353
30354
# File 'lib/ovirtsdk4/types.rb', line 30352

def has_implicit_affinity_group
  @has_implicit_affinity_group
end

#has_implicit_affinity_group=(value) ⇒ Object

Sets the value of the has_implicit_affinity_group attribute.

Parameters:

  • value (Boolean)

30361
30362
30363
# File 'lib/ovirtsdk4/types.rb', line 30361

def has_implicit_affinity_group=(value)
  @has_implicit_affinity_group = value
end

#hashObject

Generates a hash value for this object.


30517
30518
30519
30520
30521
30522
30523
# File 'lib/ovirtsdk4/types.rb', line 30517

def hash
  super +
  @has_implicit_affinity_group.hash +
  @hosts.hash +
  @read_only.hash +
  @vms.hash
end

#hostsArray<Host>

Returns the value of the hosts attribute.

Returns:


30370
30371
30372
# File 'lib/ovirtsdk4/types.rb', line 30370

def hosts
  @hosts
end

#hosts=(list) ⇒ Object

Sets the value of the hosts attribute.

Parameters:

  • list (Array<Host>)

30379
30380
30381
30382
30383
30384
30385
30386
30387
30388
30389
# File 'lib/ovirtsdk4/types.rb', line 30379

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

#idString

Returns the value of the id attribute.

Returns:

  • (String)

30396
30397
30398
# File 'lib/ovirtsdk4/types.rb', line 30396

def id
  @id
end

#id=(value) ⇒ Object

Sets the value of the id attribute.

Parameters:

  • value (String)

30405
30406
30407
# File 'lib/ovirtsdk4/types.rb', line 30405

def id=(value)
  @id = value
end

#nameString

Returns the value of the name attribute.

Returns:

  • (String)

30414
30415
30416
# File 'lib/ovirtsdk4/types.rb', line 30414

def name
  @name
end

#name=(value) ⇒ Object

Sets the value of the name attribute.

Parameters:

  • value (String)

30423
30424
30425
# File 'lib/ovirtsdk4/types.rb', line 30423

def name=(value)
  @name = value
end

#read_onlyBoolean

Returns the value of the read_only attribute.

Returns:

  • (Boolean)

30432
30433
30434
# File 'lib/ovirtsdk4/types.rb', line 30432

def read_only
  @read_only
end

#read_only=(value) ⇒ Object

Sets the value of the read_only attribute.

Parameters:

  • value (Boolean)

30441
30442
30443
# File 'lib/ovirtsdk4/types.rb', line 30441

def read_only=(value)
  @read_only = value
end

#vmsArray<Vm>

Returns the value of the vms attribute.

Returns:

  • (Array<Vm>)

30450
30451
30452
# File 'lib/ovirtsdk4/types.rb', line 30450

def vms
  @vms
end

#vms=(list) ⇒ Object

Sets the value of the vms attribute.

Parameters:

  • list (Array<Vm>)

30459
30460
30461
30462
30463
30464
30465
30466
30467
30468
30469
# File 'lib/ovirtsdk4/types.rb', line 30459

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