Class: ITRP::Cmd_flow

Inherits:
Cmd
  • Object
show all
Defined in:
lib/handlers/flow.rb

Instance Attribute Summary

Attributes inherited from Cmd

#attach_cmd, #children, #enabled_in_state, #trigger

Instance Method Summary collapse

Methods inherited from Cmd

#appstate, #find_node, #is_root?, #place_node, #print_state, #set_time_window, #treeprint

Constructor Details

#initialize(e) ⇒ Cmd_flow

Returns a new instance of Cmd_flow.



4
5
6
7
8
9
# File 'lib/handlers/flow.rb', line 4

def initialize (e)
	super(e)
	@enabled_in_state = :any
	@attach_cmd  = 'set'
	@trigger = 'flow'
end

Instance Method Details

#completions(patt) ⇒ Object



12
13
14
15
16
# File 'lib/handlers/flow.rb', line 12

def completions(patt)
    [ 
			"IP Flows {99A78737-4B41-4387-8F31-8077DB917336}"
    ].grep( /#{Regexp.escape(patt)}/i)  
end

#enter(s) ⇒ Object



18
19
20
21
22
23
24
25
26
# File 'lib/handlers/flow.rb', line 18

def enter(s)
       patt = s.scan(/set\s+flow\s+(.*)\s+({.*}$)/).flatten 
	patt = ["IP Flows",   "{99A78737-4B41-4387-8F31-8077DB917336}"]  if  patt.empty?
	print("\nContext set to flow group [#{patt[0]}] [#{patt[1]}]\n\n")
	@appenv.prompt = "iTRP F:(#{patt[0]})> "
	@appenv.context_data[:cgguid] = patt[1]
	@appenv.context_data[:cgname] = patt[0]
	@appenv.context = :flow
end