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.

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.



31913
31914
31915
31916
31917
31918
31919
# File 'lib/ovirtsdk4/types.rb', line 31913

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.



31924
31925
31926
31927
31928
31929
31930
# File 'lib/ovirtsdk4/types.rb', line 31924

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.



31734
31735
31736
# File 'lib/ovirtsdk4/types.rb', line 31734

def comment
  @comment
end

#comment=(value) ⇒ Object

Sets the value of the comment attribute.



31743
31744
31745
# File 'lib/ovirtsdk4/types.rb', line 31743

def comment=(value)
  @comment = value
end

#descriptionString

Returns the value of the description attribute.



31752
31753
31754
# File 'lib/ovirtsdk4/types.rb', line 31752

def description
  @description
end

#description=(value) ⇒ Object

Sets the value of the description attribute.



31761
31762
31763
# File 'lib/ovirtsdk4/types.rb', line 31761

def description=(value)
  @description = value
end

#has_implicit_affinity_groupBoolean

Returns the value of the has_implicit_affinity_group attribute.



31770
31771
31772
# File 'lib/ovirtsdk4/types.rb', line 31770

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.



31779
31780
31781
# File 'lib/ovirtsdk4/types.rb', line 31779

def has_implicit_affinity_group=(value)
  @has_implicit_affinity_group = value
end

#hashObject

Generates a hash value for this object.



31935
31936
31937
31938
31939
31940
31941
# File 'lib/ovirtsdk4/types.rb', line 31935

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.



31788
31789
31790
# File 'lib/ovirtsdk4/types.rb', line 31788

def hosts
  @hosts
end

#hosts=(list) ⇒ Object

Sets the value of the hosts attribute.



31797
31798
31799
31800
31801
31802
31803
31804
31805
31806
31807
# File 'lib/ovirtsdk4/types.rb', line 31797

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.



31814
31815
31816
# File 'lib/ovirtsdk4/types.rb', line 31814

def id
  @id
end

#id=(value) ⇒ Object

Sets the value of the id attribute.



31823
31824
31825
# File 'lib/ovirtsdk4/types.rb', line 31823

def id=(value)
  @id = value
end

#nameString

Returns the value of the name attribute.



31832
31833
31834
# File 'lib/ovirtsdk4/types.rb', line 31832

def name
  @name
end

#name=(value) ⇒ Object

Sets the value of the name attribute.



31841
31842
31843
# File 'lib/ovirtsdk4/types.rb', line 31841

def name=(value)
  @name = value
end

#read_onlyBoolean

Returns the value of the read_only attribute.



31850
31851
31852
# File 'lib/ovirtsdk4/types.rb', line 31850

def read_only
  @read_only
end

#read_only=(value) ⇒ Object

Sets the value of the read_only attribute.



31859
31860
31861
# File 'lib/ovirtsdk4/types.rb', line 31859

def read_only=(value)
  @read_only = value
end

#vmsArray<Vm>

Returns the value of the vms attribute.



31868
31869
31870
# File 'lib/ovirtsdk4/types.rb', line 31868

def vms
  @vms
end

#vms=(list) ⇒ Object

Sets the value of the vms attribute.



31877
31878
31879
31880
31881
31882
31883
31884
31885
31886
31887
# File 'lib/ovirtsdk4/types.rb', line 31877

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