class B2bCenterApi::Ftp

Public Class Methods

open() { |ftp| ... } click to toggle source
# File lib/b2b_center_api/ftp.rb, line 8
def open
  setup_socks
  Net::FTP.open(Settings.ftp_options[:host],
                Settings.ftp_options[:user],
                Settings.ftp_options[:password]) do |ftp|
    ftp.passive = true
    yield ftp
  end
end

Private Class Methods

setup_socks() click to toggle source
# File lib/b2b_center_api/ftp.rb, line 20
def setup_socks
  return if Settings.socks_options.blank?
  TCPSocket::socks_server = Settings.socks_options[:host] if Settings.socks_options[:host]
  TCPSocket::socks_port = Settings.socks_options[:port] if Settings.socks_options[:port]
end