Sha256: 5903d9642ae084148390a3824ab15015cfcd07221e019da8f071036c243b214b

Contents?: true

Size: 696 Bytes

Versions: 44

Compression:

Stored size: 696 Bytes

Contents

require "yaml"

module CanvasSync
  module Processors
    # Base report processing class
    class ReportProcessor
      def mapping
        CanvasSync::Concerns::SyncMapping::Mapping.default_mappings
      end

      def mapping_for(model, key = nil)
        CanvasSync::Concerns::SyncMapping.mapping_for(model, key)
      end

      def do_bulk_import(report_file_path, model, options: {}, mapping_key: nil, &blk)
        m = mapping_for(model, mapping_key)
        CanvasSync::Importers::BulkImporter.import(
          report_file_path,
          m[:columns],
          model,
          m[:conflict_target],
          import_args: options,
          &blk
        )
      end
    end
  end
end

Version data entries

44 entries across 44 versions & 1 rubygems

Version Path
canvas_sync-0.22.9 lib/canvas_sync/processors/report_processor.rb
canvas_sync-0.22.8 lib/canvas_sync/processors/report_processor.rb
canvas_sync-0.22.6 lib/canvas_sync/processors/report_processor.rb
canvas_sync-0.22.5 lib/canvas_sync/processors/report_processor.rb
canvas_sync-0.22.4 lib/canvas_sync/processors/report_processor.rb
canvas_sync-0.22.3 lib/canvas_sync/processors/report_processor.rb
canvas_sync-0.22.2 lib/canvas_sync/processors/report_processor.rb
canvas_sync-0.22.1 lib/canvas_sync/processors/report_processor.rb
canvas_sync-0.22.0 lib/canvas_sync/processors/report_processor.rb
canvas_sync-0.22.0.beta8 lib/canvas_sync/processors/report_processor.rb
canvas_sync-0.22.0.beta7 lib/canvas_sync/processors/report_processor.rb
canvas_sync-0.22.0.beta6 lib/canvas_sync/processors/report_processor.rb
canvas_sync-0.22.0.beta5 lib/canvas_sync/processors/report_processor.rb
canvas_sync-0.22.0.beta4 lib/canvas_sync/processors/report_processor.rb
canvas_sync-0.22.0.beta3 lib/canvas_sync/processors/report_processor.rb
canvas_sync-0.22.0.beta2 lib/canvas_sync/processors/report_processor.rb
canvas_sync-0.22.0.beta1 lib/canvas_sync/processors/report_processor.rb
canvas_sync-0.21.1 lib/canvas_sync/processors/report_processor.rb
canvas_sync-0.21.1.beta1 lib/canvas_sync/processors/report_processor.rb
canvas_sync-0.21.0 lib/canvas_sync/processors/report_processor.rb