Class: OvirtSDK4::Bonding
- Defined in:
- lib/ovirtsdk4/types.rb,
lib/ovirtsdk4/types.rb
Instance Method Summary collapse
-
#==(other) ⇒ Object
Returns
trueifselfandotherhave the same attributes and values. -
#active_slave ⇒ HostNic
Returns the value of the
active_slaveattribute. -
#active_slave=(value) ⇒ Object
Sets the value of the
active_slaveattribute. -
#ad_partner_mac ⇒ Mac
Returns the value of the
ad_partner_macattribute. -
#ad_partner_mac=(value) ⇒ Object
Sets the value of the
ad_partner_macattribute. -
#hash ⇒ Object
Generates a hash value for this object.
-
#initialize(opts = {}) ⇒ Bonding
constructor
Creates a new instance of the Bonding class.
-
#options ⇒ Array<Option>
Returns the value of the
optionsattribute. -
#options=(list) ⇒ Object
Sets the value of the
optionsattribute. -
#slaves ⇒ Array<HostNic>
Returns the value of the
slavesattribute. -
#slaves=(list) ⇒ Object
Sets the value of the
slavesattribute.
Methods included from Type
Constructor Details
#initialize(opts = {}) ⇒ Bonding
Creates a new instance of the OvirtSDK4::Bonding class.
1673 1674 1675 1676 1677 1678 1679 |
# File 'lib/ovirtsdk4/types.rb', line 1673 def initialize(opts = {}) super(opts) self.active_slave = opts[:active_slave] self.ad_partner_mac = opts[:ad_partner_mac] self. = opts[:options] self.slaves = opts[:slaves] end |
Instance Method Details
#==(other) ⇒ Object
Returns true if self and other have the same attributes and values.
1684 1685 1686 1687 1688 1689 1690 |
# File 'lib/ovirtsdk4/types.rb', line 1684 def ==(other) super && @active_slave == other.active_slave && @ad_partner_mac == other.ad_partner_mac && == other. && @slaves == other.slaves end |
#active_slave ⇒ HostNic
Returns the value of the active_slave attribute.
1560 1561 1562 |
# File 'lib/ovirtsdk4/types.rb', line 1560 def active_slave @active_slave end |
#active_slave=(value) ⇒ Object
Sets the value of the active_slave attribute.
The value parameter can be an instance of 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.
1573 1574 1575 1576 1577 1578 |
# File 'lib/ovirtsdk4/types.rb', line 1573 def active_slave=(value) if value.is_a?(Hash) value = HostNic.new(value) end @active_slave = value end |
#ad_partner_mac ⇒ Mac
Returns the value of the ad_partner_mac attribute.
1585 1586 1587 |
# File 'lib/ovirtsdk4/types.rb', line 1585 def ad_partner_mac @ad_partner_mac end |
#ad_partner_mac=(value) ⇒ Object
Sets the value of the ad_partner_mac attribute.
The value parameter can be an instance of 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.
1598 1599 1600 1601 1602 1603 |
# File 'lib/ovirtsdk4/types.rb', line 1598 def ad_partner_mac=(value) if value.is_a?(Hash) value = Mac.new(value) end @ad_partner_mac = value end |
#hash ⇒ Object
Generates a hash value for this object.
1695 1696 1697 1698 1699 1700 1701 |
# File 'lib/ovirtsdk4/types.rb', line 1695 def hash super + @active_slave.hash + @ad_partner_mac.hash + .hash + @slaves.hash end |
#options ⇒ Array<Option>
Returns the value of the options attribute.
1610 1611 1612 |
# File 'lib/ovirtsdk4/types.rb', line 1610 def end |
#options=(list) ⇒ Object
Sets the value of the options attribute.
1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 |
# File 'lib/ovirtsdk4/types.rb', line 1619 def (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 = list end |
#slaves ⇒ Array<HostNic>
Returns the value of the slaves attribute.
1636 1637 1638 |
# File 'lib/ovirtsdk4/types.rb', line 1636 def slaves @slaves end |
#slaves=(list) ⇒ Object
Sets the value of the slaves attribute.
1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 |
# File 'lib/ovirtsdk4/types.rb', line 1645 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 |