Module: Expect4r::Router::CiscoCommon::Show

Included in:
Ios, Iox
Defined in:
lib/router/cisco/common/show.rb

Instance Method Summary collapse

Instance Method Details

#show(s, arg = {}) ⇒ Object



4
5
6
7
8
9
10
11
12
13
# File 'lib/router/cisco/common/show.rb', line 4

def show(s, arg={})
  output = []
  nlines = 0
  s.each_line { |l|
    next unless l.strip.size>0
    output << exec("show #{l}", arg) if l.strip.size>0
    nlines +=1
  }
  nlines > 1 ? output : output[0]
end