Class: Bulkrax::SampleCsvService::FilePathGenerator

Inherits:
Object
  • Object
show all
Defined in:
app/services/bulkrax/sample_csv_service/file_path_generator.rb

Overview

Utility classes

Class Method Summary collapse

Class Method Details

.default_pathObject



6
7
8
9
10
# File 'app/services/bulkrax/sample_csv_service/file_path_generator.rb', line 6

def self.default_path
  path = Rails.root.join('tmp', 'imports', "bulkrax_template_#{timestamp}.csv")
  FileUtils.mkdir_p(path.dirname.to_s)
  path
end

.timestampObject



12
13
14
# File 'app/services/bulkrax/sample_csv_service/file_path_generator.rb', line 12

def self.timestamp
  Time.current.utc.strftime('%Y%m%d_%H%M%S')
end