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.17.0.beta15 lib/canvas_sync/processors/normal_processor.rb
canvas_sync-0.17.0.beta14 lib/canvas_sync/processors/normal_processor.rb
canvas_sync-0.17.0.beta13 lib/canvas_sync/processors/normal_processor.rb
canvas_sync-0.17.0.beta12 lib/canvas_sync/processors/normal_processor.rb
canvas_sync-0.17.0.beta11 lib/canvas_sync/processors/normal_processor.rb
canvas_sync-0.17.0.beta10 lib/canvas_sync/processors/normal_processor.rb
canvas_sync-0.17.0.beta9 lib/canvas_sync/processors/normal_processor.rb
canvas_sync-0.17.0.beta8 lib/canvas_sync/processors/normal_processor.rb
canvas_sync-0.17.0.beta7 lib/canvas_sync/processors/normal_processor.rb
canvas_sync-0.17.0.beta6 lib/canvas_sync/processors/normal_processor.rb
canvas_sync-0.17.0.beta5 lib/canvas_sync/processors/normal_processor.rb
canvas_sync-0.17.0.beta4 lib/canvas_sync/processors/normal_processor.rb
canvas_sync-0.17.0.beta3 lib/canvas_sync/processors/normal_processor.rb
canvas_sync-0.17.0.beta2 lib/canvas_sync/processors/normal_processor.rb
canvas_sync-0.17.0.beta1 lib/canvas_sync/processors/normal_processor.rb
canvas_sync-0.16.4 lib/canvas_sync/processors/normal_processor.rb
canvas_sync-0.16.3 lib/canvas_sync/processors/normal_processor.rb
canvas_sync-0.16.2 lib/canvas_sync/processors/normal_processor.rb
canvas_sync-0.16.1 lib/canvas_sync/processors/normal_processor.rb
canvas_sync-0.15.1 lib/canvas_sync/processors/normal_processor.rb