Class: Vnic
- Inherits:
-
Object
- Object
- Vnic
- Defined in:
- lib/rbvppc/vnic.rb
Overview
Authors: Christopher M Wood (<[email protected]>) John F Hutchinson (<[email protected]) © Copyright IBM Corporation 2015.
LICENSE: MIT (opensource.org/licenses/MIT)
Instance Attribute Summary collapse
-
#additional_vlan_ids ⇒ Object
Returns the value of attribute additional_vlan_ids.
-
#is_ieee ⇒ Object
Returns the value of attribute is_ieee.
-
#is_required ⇒ Object
Returns the value of attribute is_required.
-
#is_trunk ⇒ Object
Returns the value of attribute is_trunk.
-
#virtual_slot_num ⇒ Object
Returns the value of attribute virtual_slot_num.
-
#vlan_id ⇒ Object
Returns the value of attribute vlan_id.
Instance Method Summary collapse
-
#initialize(virtual_slot_num, is_ieee, vlan_id, additional_vlan_ids, is_trunk, is_required) ⇒ Vnic
constructor
A new instance of Vnic.
Constructor Details
#initialize(virtual_slot_num, is_ieee, vlan_id, additional_vlan_ids, is_trunk, is_required) ⇒ Vnic
Returns a new instance of Vnic.
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/rbvppc/vnic.rb', line 13 def initialize(virtual_slot_num, is_ieee, vlan_id, additional_vlan_ids, is_trunk, is_required) #Test for the explicitly required parameters raise StandardError.new("A vNIC cannot be defined without a virtual_slot_num") if virtual_slot_num.nil? raise StandardError.new("A vNIC cannot be defined without a vlan_id") if vlan_id.nil? raise StandardError.new("A vNIC cannot be defined without specifying is_trunk") if is_trunk.nil? raise StandardError.new("A vNIC cannot be defined without specifying is_required") if is_required.nil? is_ieee ||= 1 is_trunk ||= 0 is_required ||= 1 @virtual_slot_num = virtual_slot_num.to_i @is_ieee = is_ieee.to_i @vlan_id = vlan_id.to_i @additional_vlan_ids = additional_vlan_ids @is_trunk = is_trunk.to_i @is_required = is_required.to_i end |
Instance Attribute Details
#additional_vlan_ids ⇒ Object
Returns the value of attribute additional_vlan_ids.
10 11 12 |
# File 'lib/rbvppc/vnic.rb', line 10 def additional_vlan_ids @additional_vlan_ids end |
#is_ieee ⇒ Object
Returns the value of attribute is_ieee.
10 11 12 |
# File 'lib/rbvppc/vnic.rb', line 10 def is_ieee @is_ieee end |
#is_required ⇒ Object
Returns the value of attribute is_required.
10 11 12 |
# File 'lib/rbvppc/vnic.rb', line 10 def is_required @is_required end |
#is_trunk ⇒ Object
Returns the value of attribute is_trunk.
10 11 12 |
# File 'lib/rbvppc/vnic.rb', line 10 def is_trunk @is_trunk end |
#virtual_slot_num ⇒ Object
Returns the value of attribute virtual_slot_num.
10 11 12 |
# File 'lib/rbvppc/vnic.rb', line 10 def virtual_slot_num @virtual_slot_num end |
#vlan_id ⇒ Object
Returns the value of attribute vlan_id.
10 11 12 |
# File 'lib/rbvppc/vnic.rb', line 10 def vlan_id @vlan_id end |