Class: Auger::Telnet
- Inherits:
-
Connection
- Object
- Connection
- Auger::Telnet
- Defined in:
- lib/auger/plugin/telnet.rb
Instance Attribute Summary
Attributes inherited from Connection
#connection, #gateway, #options, #requests, #response, #roles
Instance Method Summary collapse
- #close(telnet) ⇒ Object
- #cmd(arg, &block) ⇒ Object
- #open(host, options) ⇒ Object
- #timeout(value) ⇒ Object
Methods inherited from Connection
#initialize, load, #method_missing, #try_close, #try_open, #try_open_direct, #try_open_tunnel
Constructor Details
This class inherits a constructor from Auger::Connection
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Auger::Connection
Instance Method Details
#close(telnet) ⇒ Object
22 23 24 |
# File 'lib/auger/plugin/telnet.rb', line 22 def close(telnet) telnet.close end |
#cmd(arg, &block) ⇒ Object
26 27 28 |
# File 'lib/auger/plugin/telnet.rb', line 26 def cmd(arg, &block) @requests << TelnetRequest.load(arg, &block) end |
#open(host, options) ⇒ Object
15 16 17 18 19 20 |
# File 'lib/auger/plugin/telnet.rb', line 15 def open(host, ) ## telnet opts array needs capitalized strings as keys opts = { 'Host' => host } .each { |key, value| opts[key.to_s.capitalize] = value } Net::Telnet::new(opts) end |
#timeout(value) ⇒ Object
11 12 13 |
# File 'lib/auger/plugin/telnet.rb', line 11 def timeout(value) [:timeout] = value.to_i end |