Module: Expect4r::Router::Vyatta::Show
- Included in:
- V
- Defined in:
- lib/router/vyatta/show.rb
Instance Method Summary collapse
-
#method_missing(name, *args, &block) ⇒ Object
count | match | no-match | no-more | more.
- #show(s, arg = {}) ⇒ Object
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *args, &block) ⇒ Object
count | match | no-match | no-more | more
23 24 25 26 27 28 29 30 |
# File 'lib/router/vyatta/show.rb', line 23 def method_missing(name, *args, &block) if name.to_s =~ /^show_/ cmd = name.to_s.split('_').join(' ') + args.join(' ') output = __send__ :exec, cmd, *args else super end end |
Instance Method Details
#show(s, arg = {}) ⇒ Object
5 6 7 8 9 10 11 |
# File 'lib/router/vyatta/show.rb', line 5 def show(s, arg={}) output = [] s.each_line { |l| output << exec("show #{l}", arg) if l.strip.size>0 } output end |