Sha256: aaea56dd0b8c6594d6bd4745d8c05078193ec6487b5a935d3ea53635e1617ac2

Contents?: true

Size: 812 Bytes

Versions: 41

Compression:

Stored size: 812 Bytes

Contents

require_relative "./report_processor"

module CanvasSync
  module Processors
    # Processes any report using the normal bulk importer.
    #
    # @param report_file_path [String]
    # @param options [Hash]
    # @param report_id [Integer]
    class NormalProcessor < ReportProcessor
      def self.process(report_file_path, options, report_id)
        new(report_file_path, options)
      end

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

Version data entries

41 entries across 41 versions & 1 rubygems

Version Path
canvas_sync-0.15.0 lib/canvas_sync/processors/normal_processor.rb
canvas_sync-0.14.0 lib/canvas_sync/processors/normal_processor.rb
canvas_sync-0.13.0 lib/canvas_sync/processors/normal_processor.rb
canvas_sync-0.12.0 lib/canvas_sync/processors/normal_processor.rb
canvas_sync-0.11.0 lib/canvas_sync/processors/normal_processor.rb
canvas_sync-0.10.6 lib/canvas_sync/processors/normal_processor.rb
canvas_sync-0.10.5 lib/canvas_sync/processors/normal_processor.rb
canvas_sync-0.10.4 lib/canvas_sync/processors/normal_processor.rb
canvas_sync-0.10.3 lib/canvas_sync/processors/normal_processor.rb
canvas_sync-0.10.2 lib/canvas_sync/processors/normal_processor.rb
canvas_sync-0.10.0 lib/canvas_sync/processors/normal_processor.rb
canvas_sync-0.9.4 lib/canvas_sync/processors/normal_processor.rb
canvas_sync-0.9.3 lib/canvas_sync/processors/normal_processor.rb
canvas_sync-0.9.2 lib/canvas_sync/processors/normal_processor.rb
canvas_sync-0.9.1 lib/canvas_sync/processors/normal_processor.rb
canvas_sync-0.9.0 lib/canvas_sync/processors/normal_processor.rb
canvas_sync-0.8.4 lib/canvas_sync/processors/normal_processor.rb
canvas_sync-0.8.3 lib/canvas_sync/processors/normal_processor.rb
canvas_sync-0.8.2 lib/canvas_sync/processors/normal_processor.rb
canvas_sync-0.8.1 lib/canvas_sync/processors/normal_processor.rb