Class: ShellStrike::Host
- Inherits:
-
Object
- Object
- ShellStrike::Host
- Defined in:
- lib/shell_strike/host.rb
Instance Attribute Summary collapse
-
#actions ⇒ Object
readonly
Returns the value of attribute actions.
-
#connection_timeout ⇒ Object
readonly
Returns the value of attribute connection_timeout.
-
#host ⇒ Object
readonly
Returns the value of attribute host.
-
#port ⇒ Object
readonly
Returns the value of attribute port.
Instance Method Summary collapse
-
#initialize(host, port = 22, connection_timeout = 30, actions = []) ⇒ Host
constructor
Initialises a new Host object.
-
#to_uri ⇒ String
Returns the current host’s address in URI form.
Constructor Details
#initialize(host, port = 22, connection_timeout = 30, actions = []) ⇒ Host
Initialises a new Host object.
9 10 11 12 13 14 |
# 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 |
Instance Attribute Details
#actions ⇒ Object (readonly)
Returns the value of attribute actions.
2 3 4 |
# File 'lib/shell_strike/host.rb', line 2 def actions @actions end |
#connection_timeout ⇒ Object (readonly)
Returns the value of attribute connection_timeout.
2 3 4 |
# File 'lib/shell_strike/host.rb', line 2 def connection_timeout @connection_timeout end |
#host ⇒ Object (readonly)
Returns the value of attribute host.
2 3 4 |
# File 'lib/shell_strike/host.rb', line 2 def host @host end |
#port ⇒ Object (readonly)
Returns the value of attribute port.
2 3 4 |
# File 'lib/shell_strike/host.rb', line 2 def port @port end |
Instance Method Details
#to_uri ⇒ String
Returns the current host’s address in URI form.
22 23 24 |
# File 'lib/shell_strike/host.rb', line 22 def to_uri "#{self.host}:#{self.port}" end |