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.

  • :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.



29816
29817
29818
29819
29820
29821
# File 'lib/ovirtsdk4/types.rb', line 29816

def initialize(opts = {})
  super(opts)
  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.



29826
29827
29828
29829
29830
29831
# File 'lib/ovirtsdk4/types.rb', line 29826

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

#commentString

Returns the value of the comment attribute.

Returns:

  • (String)


29657
29658
29659
# File 'lib/ovirtsdk4/types.rb', line 29657

def comment
  @comment
end

#comment=(value) ⇒ Object

Sets the value of the comment attribute.

Parameters:

  • value (String)


29666
29667
29668
# File 'lib/ovirtsdk4/types.rb', line 29666

def comment=(value)
  @comment = value
end

#descriptionString

Returns the value of the description attribute.

Returns:

  • (String)


29675
29676
29677
# File 'lib/ovirtsdk4/types.rb', line 29675

def description
  @description
end

#description=(value) ⇒ Object

Sets the value of the description attribute.

Parameters:

  • value (String)


29684
29685
29686
# File 'lib/ovirtsdk4/types.rb', line 29684

def description=(value)
  @description = value
end

#hashObject

Generates a hash value for this object.



29836
29837
29838
29839
29840
29841
# File 'lib/ovirtsdk4/types.rb', line 29836

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

#hostsArray<Host>

Returns the value of the hosts attribute.

Returns:



29693
29694
29695
# File 'lib/ovirtsdk4/types.rb', line 29693

def hosts
  @hosts
end

#hosts=(list) ⇒ Object

Sets the value of the hosts attribute.

Parameters:

  • list (Array<Host>)


29702
29703
29704
29705
29706
29707
29708
29709
29710
29711
29712
# File 'lib/ovirtsdk4/types.rb', line 29702

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)


29719
29720
29721
# File 'lib/ovirtsdk4/types.rb', line 29719

def id
  @id
end

#id=(value) ⇒ Object

Sets the value of the id attribute.

Parameters:

  • value (String)


29728
29729
29730
# File 'lib/ovirtsdk4/types.rb', line 29728

def id=(value)
  @id = value
end

#nameString

Returns the value of the name attribute.

Returns:

  • (String)


29737
29738
29739
# File 'lib/ovirtsdk4/types.rb', line 29737

def name
  @name
end

#name=(value) ⇒ Object

Sets the value of the name attribute.

Parameters:

  • value (String)


29746
29747
29748
# File 'lib/ovirtsdk4/types.rb', line 29746

def name=(value)
  @name = value
end

#read_onlyBoolean

Returns the value of the read_only attribute.

Returns:

  • (Boolean)


29755
29756
29757
# File 'lib/ovirtsdk4/types.rb', line 29755

def read_only
  @read_only
end

#read_only=(value) ⇒ Object

Sets the value of the read_only attribute.

Parameters:

  • value (Boolean)


29764
29765
29766
# File 'lib/ovirtsdk4/types.rb', line 29764

def read_only=(value)
  @read_only = value
end

#vmsArray<Vm>

Returns the value of the vms attribute.

Returns:

  • (Array<Vm>)


29773
29774
29775
# File 'lib/ovirtsdk4/types.rb', line 29773

def vms
  @vms
end

#vms=(list) ⇒ Object

Sets the value of the vms attribute.

Parameters:

  • list (Array<Vm>)


29782
29783
29784
29785
29786
29787
29788
29789
29790
29791
29792
# File 'lib/ovirtsdk4/types.rb', line 29782

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