Class: VRFTable::VRF

Inherits:
Object
  • Object
show all
Defined in:
lib/netutils/vrf.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#interfacesObject (readonly)

Returns the value of attribute interfaces.



4
5
6
# File 'lib/netutils/vrf.rb', line 4

def interfaces
  @interfaces
end

#nameObject (readonly)

Returns the value of attribute name.



4
5
6
# File 'lib/netutils/vrf.rb', line 4

def name
  @name
end

#rdObject (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_sObject



15
16
17
# File 'lib/netutils/vrf.rb', line 15

def to_s
	return "#{@name} (#{@rd})"
end