Class: Vtk::Commands::Socks::On
- Inherits:
-
Vtk::Command
- Object
- Vtk::Command
- Vtk::Commands::Socks::On
- Defined in:
- lib/vtk/commands/socks/on.rb
Overview
Turns on SOCKS connection to VA network
Instance Attribute Summary collapse
-
#input ⇒ Object
readonly
Returns the value of attribute input.
-
#output ⇒ Object
readonly
Returns the value of attribute output.
-
#port ⇒ Object
readonly
Returns the value of attribute port.
Instance Method Summary collapse
- #execute(_input: $stdin, output: $stdout) ⇒ Object
-
#initialize(options) ⇒ On
constructor
A new instance of On.
Methods inherited from Vtk::Command
#command, #cursor, #editor, #exec_exist?, #generator, #pager, #platform, #prompt, #screen, #which
Constructor Details
#initialize(options) ⇒ On
Returns a new instance of On.
12 13 14 15 16 17 |
# File 'lib/vtk/commands/socks/on.rb', line 12 def initialize() @options = @port = ['port'] || '2001' super() end |
Instance Attribute Details
#input ⇒ Object (readonly)
Returns the value of attribute input.
10 11 12 |
# File 'lib/vtk/commands/socks/on.rb', line 10 def input @input end |
#output ⇒ Object (readonly)
Returns the value of attribute output.
10 11 12 |
# File 'lib/vtk/commands/socks/on.rb', line 10 def output @output end |
#port ⇒ Object (readonly)
Returns the value of attribute port.
10 11 12 |
# File 'lib/vtk/commands/socks/on.rb', line 10 def port @port end |
Instance Method Details
#execute(_input: $stdin, output: $stdout) ⇒ Object
19 20 21 22 23 24 25 26 27 |
# File 'lib/vtk/commands/socks/on.rb', line 19 def execute(_input: $stdin, output: $stdout) @input = input @output = output return output.puts '----> Already connected to SOCKS.' if connected? connect_to_socks ensure_connection end |