class ShellStrike::Host
Attributes
actions[R]
connection_timeout[R]
host[R]
port[R]
Public Class Methods
new(host, port = 22, connection_timeout = 30, actions = [])
click to toggle source
Initialises a new Host
object. @param host [String] the hostname or IP address of the host. @param port [Number] the port number to use for the connection. @param connection_timeout
[Number] how long to wait before timing out connection attempts (in seconds). @param actions [Array<String>] Shell commands to execute against the server, upon successful connection. Interactive commands are NOT supported.
# File lib/shell_strike/host.rb, line 9 def initialize(host, port = 22, connection_timeout = 30, actions = []) @host = host @port = port @connection_timeout = connection_timeout @actions = actions end
Public Instance Methods
to_uri()
click to toggle source
Returns the current host's address in URI form. @return [String] the current host's address in URI form. (host:port) @example
192.168.1.200:22 172.20.16.20:200 example.com:22
# File lib/shell_strike/host.rb, line 22 def to_uri "#{self.host}:#{self.port}" end