Class: OvirtSDK4::VmPlacementPolicy
- Defined in:
- lib/ovirtsdk4/types.rb,
lib/ovirtsdk4/types.rb
Instance Method Summary collapse
-
#==(other) ⇒ Object
Returns
trueifselfandotherhave the same attributes and values. -
#affinity ⇒ VmAffinity
Returns the value of the
affinityattribute. -
#affinity=(value) ⇒ Object
Sets the value of the
affinityattribute. -
#hash ⇒ Object
Generates a hash value for this object.
-
#hosts ⇒ Array<Host>
Returns the value of the
hostsattribute. -
#hosts=(list) ⇒ Object
Sets the value of the
hostsattribute. -
#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.
27244 27245 27246 27247 27248 |
# File 'lib/ovirtsdk4/types.rb', line 27244 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.
27253 27254 27255 27256 27257 |
# File 'lib/ovirtsdk4/types.rb', line 27253 def ==(other) super && @affinity == other.affinity && @hosts == other.hosts end |
#affinity ⇒ VmAffinity
Returns the value of the affinity attribute.
27193 27194 27195 |
# File 'lib/ovirtsdk4/types.rb', line 27193 def affinity @affinity end |
#affinity=(value) ⇒ Object
Sets the value of the affinity attribute.
27202 27203 27204 |
# File 'lib/ovirtsdk4/types.rb', line 27202 def affinity=(value) @affinity = value end |
#hash ⇒ Object
Generates a hash value for this object.
27262 27263 27264 27265 27266 |
# File 'lib/ovirtsdk4/types.rb', line 27262 def hash super + @affinity.hash + @hosts.hash end |
#hosts ⇒ Array<Host>
Returns the value of the hosts attribute.
27211 27212 27213 |
# File 'lib/ovirtsdk4/types.rb', line 27211 def hosts @hosts end |
#hosts=(list) ⇒ Object
Sets the value of the hosts attribute.
27220 27221 27222 27223 27224 27225 27226 27227 27228 27229 27230 |
# File 'lib/ovirtsdk4/types.rb', line 27220 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 |