Class: WizTeleport::Server

Inherits:
Object
  • Object
show all
Defined in:
lib/wiz-teleport/server.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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(options)
  options = options.transform_keys(&:to_sym)
  @name = options[:name]
  @host = options[:host]
  @user = options[:user]
  @password = options[:password]
  @port = options[:port]
end

Instance Attribute Details

#hostObject (readonly)

Returns the value of attribute host.



4
5
6
# File 'lib/wiz-teleport/server.rb', line 4

def host
  @host
end

#nameObject (readonly)

Returns the value of attribute name.



4
5
6
# File 'lib/wiz-teleport/server.rb', line 4

def name
  @name
end

#passwordObject

Returns the value of attribute password.



5
6
7
# File 'lib/wiz-teleport/server.rb', line 5

def password
  @password
end

#portObject

Returns the value of attribute port.



5
6
7
# File 'lib/wiz-teleport/server.rb', line 5

def port
  @port
end

#userObject

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_hObject



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