Class: OvirtSDK4::VmPlacementPolicy
- Defined in:
- lib/ovirtsdk4/types.rb,
lib/ovirtsdk4/types.rb
Instance Method Summary collapse
-
#==(other) ⇒ Object
Returns
true
ifself
andother
have the same attributes and values. -
#affinity ⇒ VmAffinity
Returns the value of the
affinity
attribute. -
#affinity=(value) ⇒ Object
Sets the value of the
affinity
attribute. -
#hash ⇒ Object
Generates a hash value for this object.
-
#hosts ⇒ Array<Host>
Returns the value of the
hosts
attribute. -
#hosts=(list) ⇒ Object
Sets the value of the
hosts
attribute. -
#initialize(opts = {}) ⇒ VmPlacementPolicy
constructor
Creates a new instance of the VmPlacementPolicy class.
Methods included from Type
Constructor Details
#initialize(opts = {}) ⇒ VmPlacementPolicy
Creates a new instance of the OvirtSDK4::VmPlacementPolicy class.
26974 26975 26976 26977 26978 |
# File 'lib/ovirtsdk4/types.rb', line 26974 def initialize(opts = {}) super(opts) self.affinity = opts[:affinity] self.hosts = opts[:hosts] end |
Instance Method Details
#==(other) ⇒ Object
Returns true
if self
and other
have the same attributes and values.
26983 26984 26985 26986 26987 |
# File 'lib/ovirtsdk4/types.rb', line 26983 def ==(other) super && @affinity == other.affinity && @hosts == other.hosts end |
#affinity ⇒ VmAffinity
Returns the value of the affinity
attribute.
26923 26924 26925 |
# File 'lib/ovirtsdk4/types.rb', line 26923 def affinity @affinity end |
#affinity=(value) ⇒ Object
Sets the value of the affinity
attribute.
26932 26933 26934 |
# File 'lib/ovirtsdk4/types.rb', line 26932 def affinity=(value) @affinity = value end |
#hash ⇒ Object
Generates a hash value for this object.
26992 26993 26994 26995 26996 |
# File 'lib/ovirtsdk4/types.rb', line 26992 def hash super + @affinity.hash + @hosts.hash end |
#hosts ⇒ Array<Host>
Returns the value of the hosts
attribute.
26941 26942 26943 |
# File 'lib/ovirtsdk4/types.rb', line 26941 def hosts @hosts end |
#hosts=(list) ⇒ Object
Sets the value of the hosts
attribute.
26950 26951 26952 26953 26954 26955 26956 26957 26958 26959 26960 |
# File 'lib/ovirtsdk4/types.rb', line 26950 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 |