Class: Itrp::Export::Monitor::Exchange

Inherits:
Object
  • Object
show all
Defined in:
lib/itrp/export/monitor/exchange.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(export_filename, options) ⇒ Exchange

Returns a new instance of Exchange.



13
14
15
16
17
18
19
# File 'lib/itrp/export/monitor/exchange.rb', line 13

def initialize(export_filename, options)
  @options = options
  @options[:to_ftp_dir].gsub!('\\', '/')
  @fullpath = export_filename
  @basename = File.basename(export_filename)
  @logger = @options[:logger]
end

Instance Attribute Details

#basenameObject

Returns the value of attribute basename.



11
12
13
# File 'lib/itrp/export/monitor/exchange.rb', line 11

def basename
  @basename
end

#fullpathObject

Returns the value of attribute fullpath.



11
12
13
# File 'lib/itrp/export/monitor/exchange.rb', line 11

def fullpath
  @fullpath
end

#optionsObject

Returns the value of attribute options.



11
12
13
# File 'lib/itrp/export/monitor/exchange.rb', line 11

def options
  @options
end

Instance Method Details

#transferObject



21
22
23
24
25
# File 'lib/itrp/export/monitor/exchange.rb', line 21

def transfer
  files = transfer_files
  local_transfer(files) unless option(:to).blank?
  ftp_transfer(files) unless option(:to_ftp).blank?
end