Creates a new instance of the {Bonding} class.
@param opts [Hash] 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.
@option opts [HostNic, Hash] :active_slave The value of attribute `active_slave`.
@option opts [Mac, Hash] :ad_partner_mac The value of attribute `ad_partner_mac`.
@option opts [Array<Option>, Array<Hash>] :options The values of attribute `options`.
@option opts [Array<HostNic>, Array<Hash>] :slaves The values of attribute `slaves`.
# File lib/ovirtsdk4/types.rb, line 1491 def initialize(opts = {}) super(opts) self.active_slave = opts[:active_slave] self.ad_partner_mac = opts[:ad_partner_mac] self.options = opts[:options] self.slaves = opts[:slaves] end
Returns `true` if `self` and `other` have the same attributes and values.
# File lib/ovirtsdk4/types.rb, line 1502 def ==(other) super && @active_slave == other.active_slave && @ad_partner_mac == other.ad_partner_mac && @options == other.options && @slaves == other.slaves end
Returns the value of the `active_slave` attribute.
@return [HostNic]
# File lib/ovirtsdk4/types.rb, line 1378 def active_slave @active_slave end
Sets the value of the `active_slave` attribute.
@param value [HostNic, Hash]
The `value` parameter can be an instance of {OvirtSDK4::HostNic} or a hash. If it is a hash then a new instance will be created passing the hash as the `opts` parameter to the constructor.
# File lib/ovirtsdk4/types.rb, line 1391 def active_slave=(value) if value.is_a?(Hash) value = HostNic.new(value) end @active_slave = value end
Returns the value of the `ad_partner_mac` attribute.
@return [Mac]
# File lib/ovirtsdk4/types.rb, line 1403 def ad_partner_mac @ad_partner_mac end
Sets the value of the `ad_partner_mac` attribute.
@param value [Mac, Hash]
The `value` parameter can be an instance of {OvirtSDK4::Mac} or a hash. If it is a hash then a new instance will be created passing the hash as the `opts` parameter to the constructor.
# File lib/ovirtsdk4/types.rb, line 1416 def ad_partner_mac=(value) if value.is_a?(Hash) value = Mac.new(value) end @ad_partner_mac = value end
Generates a hash value for this object.
# File lib/ovirtsdk4/types.rb, line 1513 def hash super + @active_slave.hash + @ad_partner_mac.hash + @options.hash + @slaves.hash end
Returns the value of the `options` attribute.
@return [Array<Option>]
# File lib/ovirtsdk4/types.rb, line 1428 def options @options end
Sets the value of the `options` attribute.
@param list [Array<Option>]
# File lib/ovirtsdk4/types.rb, line 1437 def options=(list) if list.class == Array list = List.new(list) list.each_with_index do |value, index| if value.is_a?(Hash) list[index] = Option.new(value) end end end @options = list end
Returns the value of the `slaves` attribute.
@return [Array<HostNic>]
# File lib/ovirtsdk4/types.rb, line 1454 def slaves @slaves end
Sets the value of the `slaves` attribute.
@param list [Array<HostNic>]
# File lib/ovirtsdk4/types.rb, line 1463 def slaves=(list) if list.class == Array list = List.new(list) list.each_with_index do |value, index| if value.is_a?(Hash) list[index] = HostNic.new(value) end end end @slaves = list end