Class: Vtk::Commands::Socks::Off
- Inherits:
-
Vtk::Command
- Object
- Vtk::Command
- Vtk::Commands::Socks::Off
- Defined in:
- lib/vtk/commands/socks/off.rb
Overview
Turns off SOCKS connection to VA network
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
- #execute(_input: $stdin, output: $stdout) ⇒ Object
-
#initialize(options) ⇒ Off
constructor
A new instance of Off.
Methods inherited from Vtk::Command
#command, #cursor, #editor, #exec_exist?, #generator, #pager, #platform, #prompt, #screen, #which
Constructor Details
#initialize(options) ⇒ Off
Returns a new instance of Off.
12 13 14 15 16 |
# File 'lib/vtk/commands/socks/off.rb', line 12 def initialize() @options = super() end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
10 11 12 |
# File 'lib/vtk/commands/socks/off.rb', line 10 def @options end |
Instance Method Details
#execute(_input: $stdin, output: $stdout) ⇒ Object
18 19 20 21 22 23 24 25 26 |
# File 'lib/vtk/commands/socks/off.rb', line 18 def execute(_input: $stdin, output: $stdout) pids_killed = running_pids.map { |pid| kill_pid pid } if pids_killed.any? && pids_killed.all? output.puts '----> Disconnected from SOCKS.' else output.puts '----> No SOCKS connection found.' end end |