Class: VRFTable

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

Defined Under Namespace

Classes: VRF

Instance Method Summary collapse

Constructor Details

#initializeVRFTable

Returns a new instance of VRFTable.



20
21
22
# File 'lib/netutils/vrf.rb', line 20

def initialize
	@table = {}
end

Instance Method Details

#[](name) ⇒ Object



30
31
32
# File 'lib/netutils/vrf.rb', line 30

def [](name)
	return @table[name]
end

#add(name, rd) ⇒ Object



24
25
26
27
28
# File 'lib/netutils/vrf.rb', line 24

def add(name, rd)
	vrf = VRF.new(name, rd)
	@table[name] = vrf
	return vrf
end

#eachObject



39
40
41
# File 'lib/netutils/vrf.rb', line 39

def each
	@table.each { |vrf| yield vrf }
end

#empty?Boolean

Returns:

  • (Boolean)


35
36
37
# File 'lib/netutils/vrf.rb', line 35

def empty?
	@table.empty?
end