Class: SSHMan::Connection
- Inherits:
-
Object
- Object
- SSHMan::Connection
- Defined in:
- lib/sshman/connection.rb
Instance Attribute Summary collapse
-
#auth_type ⇒ Object
Returns the value of attribute auth_type.
-
#host ⇒ Object
Returns the value of attribute host.
-
#name ⇒ Object
Returns the value of attribute name.
-
#port ⇒ Object
Returns the value of attribute port.
-
#ssh_key ⇒ Object
Returns the value of attribute ssh_key.
-
#user ⇒ Object
Returns the value of attribute user.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(name, host, user, port, auth_type, ssh_key = nil) ⇒ Connection
constructor
A new instance of Connection.
- #to_h ⇒ Object
Constructor Details
#initialize(name, host, user, port, auth_type, ssh_key = nil) ⇒ Connection
Returns a new instance of Connection.
6 7 8 9 10 11 12 13 |
# File 'lib/sshman/connection.rb', line 6 def initialize(name, host, user, port, auth_type, ssh_key = nil) @name = name @host = host @user = user @port = port @auth_type = auth_type @ssh_key = ssh_key end |
Instance Attribute Details
#auth_type ⇒ Object
Returns the value of attribute auth_type.
4 5 6 |
# File 'lib/sshman/connection.rb', line 4 def auth_type @auth_type end |
#host ⇒ Object
Returns the value of attribute host.
4 5 6 |
# File 'lib/sshman/connection.rb', line 4 def host @host end |
#name ⇒ Object
Returns the value of attribute name.
4 5 6 |
# File 'lib/sshman/connection.rb', line 4 def name @name end |
#port ⇒ Object
Returns the value of attribute port.
4 5 6 |
# File 'lib/sshman/connection.rb', line 4 def port @port end |
#ssh_key ⇒ Object
Returns the value of attribute ssh_key.
4 5 6 |
# File 'lib/sshman/connection.rb', line 4 def ssh_key @ssh_key end |
#user ⇒ Object
Returns the value of attribute user.
4 5 6 |
# File 'lib/sshman/connection.rb', line 4 def user @user end |
Class Method Details
.from_h(hash) ⇒ Object
26 27 28 |
# File 'lib/sshman/connection.rb', line 26 def self.from_h(hash) new(hash[:name], hash[:host], hash[:user], hash[:port], hash[:auth_type], hash[:ssh_key]) end |
Instance Method Details
#to_h ⇒ Object
15 16 17 18 19 20 21 22 23 24 |
# File 'lib/sshman/connection.rb', line 15 def to_h { name: @name, host: @host, user: @user, port: @port, auth_type: @auth_type, ssh_key: @ssh_key } end |