Class: CsvService

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(result_id) ⇒ CsvService

Returns a new instance of CsvService.



5
6
7
8
9
10
11
# File 'lib/csv_service.rb', line 5

def initialize(result_id)
  if APP_CONFIG['s3_bucket']
    @service_impl = CsvHelper::Aws.new(result_id)
  else
    @service_impl = CsvHelper::Local.new(result_id)
  end
end

Instance Attribute Details

#service_implObject (readonly)

Returns the value of attribute service_impl.



2
3
4
# File 'lib/csv_service.rb', line 2

def service_impl
  @service_impl
end

Instance Method Details

#clear_tmp_fileObject



13
14
15
# File 'lib/csv_service.rb', line 13

def clear_tmp_file
  File.delete(filepath) if File.exist?(filepath)
end