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.
25680 25681 25682 25683 25684 |
# File 'lib/ovirtsdk4/types.rb', line 25680 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.
25689 25690 25691 25692 25693 |
# File 'lib/ovirtsdk4/types.rb', line 25689 def ==(other) super && @affinity == other.affinity && @hosts == other.hosts end |
#affinity ⇒ VmAffinity
Returns the value of the affinity
attribute.
25629 25630 25631 |
# File 'lib/ovirtsdk4/types.rb', line 25629 def affinity @affinity end |
#affinity=(value) ⇒ Object
Sets the value of the affinity
attribute.
25638 25639 25640 |
# File 'lib/ovirtsdk4/types.rb', line 25638 def affinity=(value) @affinity = value end |
#hash ⇒ Object
Generates a hash value for this object.
25698 25699 25700 25701 25702 |
# File 'lib/ovirtsdk4/types.rb', line 25698 def hash super + @affinity.hash + @hosts.hash end |
#hosts ⇒ Array<Host>
Returns the value of the hosts
attribute.
25647 25648 25649 |
# File 'lib/ovirtsdk4/types.rb', line 25647 def hosts @hosts end |
#hosts=(list) ⇒ Object
Sets the value of the hosts
attribute.
25656 25657 25658 25659 25660 25661 25662 25663 25664 25665 25666 |
# File 'lib/ovirtsdk4/types.rb', line 25656 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 |