Class: WizTeleport::Server
- Inherits:
-
Object
- Object
- WizTeleport::Server
- Defined in:
- lib/wiz-teleport/server.rb
Instance Attribute Summary collapse
-
#host ⇒ Object
readonly
Returns the value of attribute host.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#password ⇒ Object
Returns the value of attribute password.
-
#port ⇒ Object
Returns the value of attribute port.
-
#user ⇒ Object
Returns the value of attribute user.
Instance Method Summary collapse
-
#initialize(options) ⇒ Server
constructor
A new instance of Server.
- #to_h ⇒ Object
Constructor Details
#initialize(options) ⇒ Server
Returns a new instance of Server.
7 8 9 10 11 12 13 14 |
# File 'lib/wiz-teleport/server.rb', line 7 def initialize() = .transform_keys(&:to_sym) @name = [:name] @host = [:host] @user = [:user] @password = [:password] @port = [:port] end |
Instance Attribute Details
#host ⇒ Object (readonly)
Returns the value of attribute host.
4 5 6 |
# File 'lib/wiz-teleport/server.rb', line 4 def host @host end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
4 5 6 |
# File 'lib/wiz-teleport/server.rb', line 4 def name @name end |
#password ⇒ Object
Returns the value of attribute password.
5 6 7 |
# File 'lib/wiz-teleport/server.rb', line 5 def password @password end |
#port ⇒ Object
Returns the value of attribute port.
5 6 7 |
# File 'lib/wiz-teleport/server.rb', line 5 def port @port end |
#user ⇒ Object
Returns the value of attribute user.
5 6 7 |
# File 'lib/wiz-teleport/server.rb', line 5 def user @user end |
Instance Method Details
#to_h ⇒ Object
16 17 18 19 20 21 22 23 |
# File 'lib/wiz-teleport/server.rb', line 16 def to_h h = {'host' => @host} h['name'] = @name if @name h['user'] = @user if @user h['password'] = @password if @password h['port'] = @port if @port h end |