Class: OvirtSDK4::Bonding
- 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. -
#active_slave ⇒ HostNic
Returns the value of the
active_slave
attribute. -
#active_slave=(value) ⇒ Object
Sets the value of the
active_slave
attribute. -
#ad_partner_mac ⇒ Mac
Returns the value of the
ad_partner_mac
attribute. -
#ad_partner_mac=(value) ⇒ Object
Sets the value of the
ad_partner_mac
attribute. -
#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
options
attribute. -
#options=(list) ⇒ Object
Sets the value of the
options
attribute. -
#slaves ⇒ Array<HostNic>
Returns the value of the
slaves
attribute. -
#slaves=(list) ⇒ Object
Sets the value of the
slaves
attribute.
Methods included from Type
Constructor Details
#initialize(opts = {}) ⇒ Bonding
Creates a new instance of the OvirtSDK4::Bonding class.
1590 1591 1592 1593 1594 1595 1596 |
# File 'lib/ovirtsdk4/types.rb', line 1590 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.
1601 1602 1603 1604 1605 1606 1607 |
# File 'lib/ovirtsdk4/types.rb', line 1601 def ==(other) super && @active_slave == other.active_slave && @ad_partner_mac == other.ad_partner_mac && @options == other. && @slaves == other.slaves end |
#active_slave ⇒ HostNic
Returns the value of the active_slave
attribute.
1477 1478 1479 |
# File 'lib/ovirtsdk4/types.rb', line 1477 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.
1490 1491 1492 1493 1494 1495 |
# File 'lib/ovirtsdk4/types.rb', line 1490 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.
1502 1503 1504 |
# File 'lib/ovirtsdk4/types.rb', line 1502 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.
1515 1516 1517 1518 1519 1520 |
# File 'lib/ovirtsdk4/types.rb', line 1515 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.
1612 1613 1614 1615 1616 1617 1618 |
# File 'lib/ovirtsdk4/types.rb', line 1612 def hash super + @active_slave.hash + @ad_partner_mac.hash + @options.hash + @slaves.hash end |
#options ⇒ Array<Option>
Returns the value of the options
attribute.
1527 1528 1529 |
# File 'lib/ovirtsdk4/types.rb', line 1527 def @options end |
#options=(list) ⇒ Object
Sets the value of the options
attribute.
1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 |
# File 'lib/ovirtsdk4/types.rb', line 1536 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 @options = list end |
#slaves ⇒ Array<HostNic>
Returns the value of the slaves
attribute.
1553 1554 1555 |
# File 'lib/ovirtsdk4/types.rb', line 1553 def slaves @slaves end |
#slaves=(list) ⇒ Object
Sets the value of the slaves
attribute.
1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 |
# File 'lib/ovirtsdk4/types.rb', line 1562 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 |