Class: PgExport::Ftp::Connection

Inherits:
Object
  • Object
show all
Defined in:
lib/pg_export/ftp/connection.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(host:, user:, password:, logger:) ⇒ Connection

Returns a new instance of Connection.



8
9
10
11
# File 'lib/pg_export/ftp/connection.rb', line 8

def initialize(host:, user:, password:, logger:)
  @host, @user, @password, @logger = host, user, password, logger
  open_ftp_thread
end

Instance Attribute Details

#hostObject (readonly)

Returns the value of attribute host.



6
7
8
# File 'lib/pg_export/ftp/connection.rb', line 6

def host
  @host
end

Instance Method Details

#closeObject



18
19
20
21
22
# File 'lib/pg_export/ftp/connection.rb', line 18

def close
  ftp.close
  logger.info 'Close FTP'
  self
end

#ftpObject



13
14
15
16
# File 'lib/pg_export/ftp/connection.rb', line 13

def ftp
  open_ftp_thread.join
  @ftp
end