Class: Cisco::ShowInterface

Inherits:
Parser show all
Defined in:
lib/netutils/cli/cisco/showinterface.rb

Constant Summary

Constants inherited from FSM

FSM::FSM_S_INIT

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Parser

#add, #parse, #regexp

Methods inherited from FSM

#add, #cb, #changeto, #state_name

Constructor Details

#initializeShowInterface

Returns a new instance of ShowInterface.



9
10
11
12
13
# File 'lib/netutils/cli/cisco/showinterface.rb', line 9

def initialize
	super()
	add('Init',	:init)
	add('Done',	:done)
end

Instance Attribute Details

#tunnelObject (readonly)

Returns the value of attribute tunnel.



7
8
9
# File 'lib/netutils/cli/cisco/showinterface.rb', line 7

def tunnel
  @tunnel
end

Instance Method Details

#done(l, m) ⇒ Object



23
24
# File 'lib/netutils/cli/cisco/showinterface.rb', line 23

def done(l, m)
end

#init(l, m) ⇒ Object



15
16
17
18
19
20
21
# File 'lib/netutils/cli/cisco/showinterface.rb', line 15

def init(l, m)
	# Tunnel source 192.168.0.1 (Dialer1), destination 192.168.0.2
	if l =~ /^  Tunnel source ([^ ]+) [^,]+, destination ([^ ]+)/
		@tunnel = Tunnel.new($1, $2)
		changeto('Done')
	end
end