Class: SSHHost
- Inherits:
-
Object
- Object
- SSHHost
- Defined in:
- lib/smartos-manager/core.rb
Instance Attribute Summary collapse
-
#address ⇒ Object
readonly
Returns the value of attribute address.
-
#gateway ⇒ Object
readonly
Returns the value of attribute gateway.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#user ⇒ Object
readonly
Returns the value of attribute user.
Class Method Summary collapse
Instance Method Summary collapse
- #gateway_user ⇒ Object
-
#initialize(name: nil, address: nil, gateway: nil, user: nil, gateway_user: nil) ⇒ SSHHost
constructor
A new instance of SSHHost.
Constructor Details
#initialize(name: nil, address: nil, gateway: nil, user: nil, gateway_user: nil) ⇒ SSHHost
Returns a new instance of SSHHost.
25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/smartos-manager/core.rb', line 25 def initialize(name: nil, address: nil, gateway: nil, user: nil, gateway_user: nil) raise "address required" unless address @name= name @address = address @user = user @gateway = gateway @gateway_user = gateway_user end |
Instance Attribute Details
#address ⇒ Object (readonly)
Returns the value of attribute address.
12 13 14 |
# File 'lib/smartos-manager/core.rb', line 12 def address @address end |
#gateway ⇒ Object (readonly)
Returns the value of attribute gateway.
13 14 15 |
# File 'lib/smartos-manager/core.rb', line 13 def gateway @gateway end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
11 12 13 |
# File 'lib/smartos-manager/core.rb', line 11 def name @name end |
#user ⇒ Object (readonly)
Returns the value of attribute user.
12 13 14 |
# File 'lib/smartos-manager/core.rb', line 12 def user @user end |
Class Method Details
.from_hash(name, h, global_h) ⇒ Object
15 16 17 18 19 20 21 22 23 |
# File 'lib/smartos-manager/core.rb', line 15 def self.from_hash(name, h, global_h) new( name: name, address: h['address'], gateway: h['gateway'] || global_h['gateway'], user: h['user'] || global_h['user'], gateway_user: h['gateway_user'] || global_h['gateway_user'] ) end |
Instance Method Details
#gateway_user ⇒ Object
41 42 43 |
# File 'lib/smartos-manager/core.rb', line 41 def gateway_user @gateway_user || user end |