class OvirtSDK4::Bonding
Public Class Methods
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`.
OvirtSDK4::Struct::new
# File lib/ovirtsdk4/types.rb, line 1640 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
Public Instance Methods
Returns `true` if `self` and `other` have the same attributes and values.
# File lib/ovirtsdk4/types.rb, line 1651 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 1527 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 1540 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 1552 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 1565 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.
OvirtSDK4::Struct#hash
# File lib/ovirtsdk4/types.rb, line 1662 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 1577 def options @options end
Sets the value of the `options` attribute.
@param list [Array<Option>]
# File lib/ovirtsdk4/types.rb, line 1586 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 1603 def slaves @slaves end
Sets the value of the `slaves` attribute.
@param list [Array<HostNic>]
# File lib/ovirtsdk4/types.rb, line 1612 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