Class: Oxidized::Script
- Inherits:
-
Object
- Object
- Oxidized::Script
- Defined in:
- lib/oxidized/script/cli.rb,
lib/oxidized/script/script.rb,
lib/oxidized/script/command.rb,
lib/oxidized/script/commands/list-nodes.rb,
lib/oxidized/script/commands/list-models.rb
Defined Under Namespace
Modules: Command Classes: CLI, InvalidOption, NoConnection, NoNode, ScriptError
Instance Attribute Summary collapse
-
#model ⇒ Object
readonly
Returns the value of attribute model.
Instance Method Summary collapse
-
#cmd(command) ⇒ String
Output for command.
-
#disconnect ⇒ void
(also: #close)
disconnects from ssh/telnet session.
Instance Attribute Details
#model ⇒ Object (readonly)
Returns the value of attribute model.
7 8 9 |
# File 'lib/oxidized/script/script.rb', line 7 def model @model end |
Instance Method Details
#cmd(command) ⇒ String
Returns output for command.
19 20 21 22 23 24 25 26 |
# File 'lib/oxidized/script/script.rb', line 19 def cmd command out = '' out += "## HOST - #{@host}\n" if @verbose out += "## OXS - #{command}\n" if @verbose cmd_out = @model.cmd command out += cmd_out if cmd_out out end |
#disconnect ⇒ void Also known as: close
This method returns an undefined value.
disconnects from ssh/telnet session
30 31 32 |
# File 'lib/oxidized/script/script.rb', line 30 def disconnect @input.disconnect_cli end |