Class: CanvasSync::Processors::NormalProcessor

Inherits:
ReportProcessor show all
Defined in:
lib/canvas_sync/processors/normal_processor.rb

Overview

Processes any report using the normal bulk importer.

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from ReportProcessor

#do_bulk_import, #mapping, #mapping_for

Constructor Details

#initialize(report_file_path, options) ⇒ NormalProcessor

Returns a new instance of NormalProcessor.



15
16
17
18
19
20
21
22
23
# File 'lib/canvas_sync/processors/normal_processor.rb', line 15

def initialize(report_file_path, options)
  m = mapping[options[:mapping].to_sym]
  CanvasSync::Importers::BulkImporter.import(
    report_file_path,
    m[:columns],
    options[:klass].constantize,
    m[:conflict_target],
  )
end

Class Method Details

.process(report_file_path, options, report_id) ⇒ Object



11
12
13
# File 'lib/canvas_sync/processors/normal_processor.rb', line 11

def self.process(report_file_path, options, report_id)
  new(report_file_path, options)
end