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.



31620
31621
31622
31623
31624
31625
31626
# File 'lib/ovirtsdk4/types.rb', line 31620

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.



31631
31632
31633
31634
31635
31636
31637
# File 'lib/ovirtsdk4/types.rb', line 31631

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)


31441
31442
31443
# File 'lib/ovirtsdk4/types.rb', line 31441

def comment
  @comment
end

#comment=(value) ⇒ Object

Sets the value of the comment attribute.

Parameters:

  • value (String)


31450
31451
31452
# File 'lib/ovirtsdk4/types.rb', line 31450

def comment=(value)
  @comment = value
end

#descriptionString

Returns the value of the description attribute.

Returns:

  • (String)


31459
31460
31461
# File 'lib/ovirtsdk4/types.rb', line 31459

def description
  @description
end

#description=(value) ⇒ Object

Sets the value of the description attribute.

Parameters:

  • value (String)


31468
31469
31470
# File 'lib/ovirtsdk4/types.rb', line 31468

def description=(value)
  @description = value
end

#has_implicit_affinity_groupBoolean

Returns the value of the has_implicit_affinity_group attribute.

Returns:

  • (Boolean)


31477
31478
31479
# File 'lib/ovirtsdk4/types.rb', line 31477

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)


31486
31487
31488
# File 'lib/ovirtsdk4/types.rb', line 31486

def has_implicit_affinity_group=(value)
  @has_implicit_affinity_group = value
end

#hashObject

Generates a hash value for this object.



31642
31643
31644
31645
31646
31647
31648
# File 'lib/ovirtsdk4/types.rb', line 31642

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:



31495
31496
31497
# File 'lib/ovirtsdk4/types.rb', line 31495

def hosts
  @hosts
end

#hosts=(list) ⇒ Object

Sets the value of the hosts attribute.

Parameters:

  • list (Array<Host>)


31504
31505
31506
31507
31508
31509
31510
31511
31512
31513
31514
# File 'lib/ovirtsdk4/types.rb', line 31504

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)


31521
31522
31523
# File 'lib/ovirtsdk4/types.rb', line 31521

def id
  @id
end

#id=(value) ⇒ Object

Sets the value of the id attribute.

Parameters:

  • value (String)


31530
31531
31532
# File 'lib/ovirtsdk4/types.rb', line 31530

def id=(value)
  @id = value
end

#nameString

Returns the value of the name attribute.

Returns:

  • (String)


31539
31540
31541
# File 'lib/ovirtsdk4/types.rb', line 31539

def name
  @name
end

#name=(value) ⇒ Object

Sets the value of the name attribute.

Parameters:

  • value (String)


31548
31549
31550
# File 'lib/ovirtsdk4/types.rb', line 31548

def name=(value)
  @name = value
end

#read_onlyBoolean

Returns the value of the read_only attribute.

Returns:

  • (Boolean)


31557
31558
31559
# File 'lib/ovirtsdk4/types.rb', line 31557

def read_only
  @read_only
end

#read_only=(value) ⇒ Object

Sets the value of the read_only attribute.

Parameters:

  • value (Boolean)


31566
31567
31568
# File 'lib/ovirtsdk4/types.rb', line 31566

def read_only=(value)
  @read_only = value
end

#vmsArray<Vm>

Returns the value of the vms attribute.

Returns:

  • (Array<Vm>)


31575
31576
31577
# File 'lib/ovirtsdk4/types.rb', line 31575

def vms
  @vms
end

#vms=(list) ⇒ Object

Sets the value of the vms attribute.

Parameters:

  • list (Array<Vm>)


31584
31585
31586
31587
31588
31589
31590
31591
31592
31593
31594
# File 'lib/ovirtsdk4/types.rb', line 31584

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