Class: VRFTable::VRF
- Inherits:
-
Object
- Object
- VRFTable::VRF
- Defined in:
- lib/netutils/vrf.rb
Instance Attribute Summary collapse
-
#interfaces ⇒ Object
readonly
Returns the value of attribute interfaces.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#rd ⇒ Object
readonly
Returns the value of attribute rd.
Instance Method Summary collapse
-
#initialize(name, rd) ⇒ VRF
constructor
A new instance of VRF.
- #interface_add(ifname) ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(name, rd) ⇒ VRF
Returns a new instance of VRF.
5 6 7 8 9 |
# File 'lib/netutils/vrf.rb', line 5 def initialize(name, rd) @name = name @rd = rd if rd =~ /[0-9]+:[0-9]/ @interfaces = [] end |
Instance Attribute Details
#interfaces ⇒ Object (readonly)
Returns the value of attribute interfaces.
4 5 6 |
# File 'lib/netutils/vrf.rb', line 4 def interfaces @interfaces end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
4 5 6 |
# File 'lib/netutils/vrf.rb', line 4 def name @name end |
#rd ⇒ Object (readonly)
Returns the value of attribute rd.
4 5 6 |
# File 'lib/netutils/vrf.rb', line 4 def rd @rd end |
Instance Method Details
#interface_add(ifname) ⇒ Object
11 12 13 |
# File 'lib/netutils/vrf.rb', line 11 def interface_add(ifname) @interfaces.push(ifname) end |
#to_s ⇒ Object
15 16 17 |
# File 'lib/netutils/vrf.rb', line 15 def to_s return "#{@name} (#{@rd})" end |