Sha256: 8cd755d9485bb9197df3584d2df05d2ed5022124fc5143b8620d8351343ff4e4

Contents?: true

Size: 617 Bytes

Versions: 3

Compression:

Stored size: 617 Bytes

Contents

# frozen_string_literal: true
module WizTeleport
  class Server
    attr_reader :host, :name
    attr_accessor :user, :password, :port

    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

    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

  end
end


Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
wiz-teleport-0.5.1 lib/wiz-teleport/server.rb
wiz-teleport-0.5.0 lib/wiz-teleport/server.rb
wiz-teleport-0.4.0 lib/wiz-teleport/server.rb