Class: RsrGroup::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/rsr_group/base.rb

Constant Summary collapse

KEYDEALER_DIR =
'keydealer'.freeze
DEFAULT_DIR =
'ftpdownloads'.freeze
QTY_FILENAME =
'IM-QTY-CSV.csv'.freeze
MAP_FILENAME =
'retail-map.csv'.freeze
DEFAULT_CATALOG_FILENAME =
'rsrinventory-new.txt'.freeze
KEYDEALER_CATALOG_FILENAME =
'rsrinventory-keydlr-new.txt'.freeze

Class Method Summary collapse

Class Method Details

.connect(options = {}) ⇒ Object



11
12
13
14
15
16
17
18
19
# File 'lib/rsr_group/base.rb', line 11

def self.connect(options = {})
  requires!(options, :username, :password)

  Net::FTP.open(RsrGroup.config.ftp_host, options[:username], options[:password]) do |ftp|
    ftp.debug_mode = RsrGroup.config.debug_mode
    ftp.passive = true
    yield ftp
  end
end