Method: Rbeapi::Client::Node#config
- Defined in:
- lib/rbeapi/client.rb
#config(commands, opts = {}) ⇒ Array<Hash>
The config method is a convenience method that will handling putting the switch into config mode prior to executing commands. The method will insert ‘config’ at the top of the command stack and then pop the empty hash from the response output before return the array to the caller.
| 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 | # File 'lib/rbeapi/client.rb', line 362 def config(commands, opts = {}) commands = [*commands] unless commands.respond_to?('each') commands.insert(0, 'configure terminal') if @dry_run puts '[rbeapi dry-run commands]' puts commands else response = run_commands(commands, opts) refresh if @autorefresh response.shift response end end |