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.


30910
30911
30912
30913
30914
30915
30916
# File 'lib/ovirtsdk4/types.rb', line 30910

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.


30921
30922
30923
30924
30925
30926
30927
# File 'lib/ovirtsdk4/types.rb', line 30921

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)

30731
30732
30733
# File 'lib/ovirtsdk4/types.rb', line 30731

def comment
  @comment
end

#comment=(value) ⇒ Object

Sets the value of the comment attribute.

Parameters:

  • value (String)

30740
30741
30742
# File 'lib/ovirtsdk4/types.rb', line 30740

def comment=(value)
  @comment = value
end

#descriptionString

Returns the value of the description attribute.

Returns:

  • (String)

30749
30750
30751
# File 'lib/ovirtsdk4/types.rb', line 30749

def description
  @description
end

#description=(value) ⇒ Object

Sets the value of the description attribute.

Parameters:

  • value (String)

30758
30759
30760
# File 'lib/ovirtsdk4/types.rb', line 30758

def description=(value)
  @description = value
end

#has_implicit_affinity_groupBoolean

Returns the value of the has_implicit_affinity_group attribute.

Returns:

  • (Boolean)

30767
30768
30769
# File 'lib/ovirtsdk4/types.rb', line 30767

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)

30776
30777
30778
# File 'lib/ovirtsdk4/types.rb', line 30776

def has_implicit_affinity_group=(value)
  @has_implicit_affinity_group = value
end

#hashObject

Generates a hash value for this object.


30932
30933
30934
30935
30936
30937
30938
# File 'lib/ovirtsdk4/types.rb', line 30932

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:


30785
30786
30787
# File 'lib/ovirtsdk4/types.rb', line 30785

def hosts
  @hosts
end

#hosts=(list) ⇒ Object

Sets the value of the hosts attribute.

Parameters:

  • list (Array<Host>)

30794
30795
30796
30797
30798
30799
30800
30801
30802
30803
30804
# File 'lib/ovirtsdk4/types.rb', line 30794

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)

30811
30812
30813
# File 'lib/ovirtsdk4/types.rb', line 30811

def id
  @id
end

#id=(value) ⇒ Object

Sets the value of the id attribute.

Parameters:

  • value (String)

30820
30821
30822
# File 'lib/ovirtsdk4/types.rb', line 30820

def id=(value)
  @id = value
end

#nameString

Returns the value of the name attribute.

Returns:

  • (String)

30829
30830
30831
# File 'lib/ovirtsdk4/types.rb', line 30829

def name
  @name
end

#name=(value) ⇒ Object

Sets the value of the name attribute.

Parameters:

  • value (String)

30838
30839
30840
# File 'lib/ovirtsdk4/types.rb', line 30838

def name=(value)
  @name = value
end

#read_onlyBoolean

Returns the value of the read_only attribute.

Returns:

  • (Boolean)

30847
30848
30849
# File 'lib/ovirtsdk4/types.rb', line 30847

def read_only
  @read_only
end

#read_only=(value) ⇒ Object

Sets the value of the read_only attribute.

Parameters:

  • value (Boolean)

30856
30857
30858
# File 'lib/ovirtsdk4/types.rb', line 30856

def read_only=(value)
  @read_only = value
end

#vmsArray<Vm>

Returns the value of the vms attribute.

Returns:

  • (Array<Vm>)

30865
30866
30867
# File 'lib/ovirtsdk4/types.rb', line 30865

def vms
  @vms
end

#vms=(list) ⇒ Object

Sets the value of the vms attribute.

Parameters:

  • list (Array<Vm>)

30874
30875
30876
30877
30878
30879
30880
30881
30882
30883
30884
# File 'lib/ovirtsdk4/types.rb', line 30874

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