Class: Card::Migration::Import::Merger

Inherits:
Object
  • Object
show all
Defined in:
lib/card/migration/import/merger.rb

Overview

executes the card import

Constant Summary collapse

OUTPUT_FILE =
Card::Migration.data_path "unmerged"

Instance Method Summary collapse

Constructor Details

#initialize(opts = {}) ⇒ Merger

Returns a new instance of Merger.



8
9
10
# File 'lib/card/migration/import/merger.rb', line 8

def initialize opts={}
  load_data opts
end

Instance Method Details

#mergeObject



12
13
14
15
16
17
18
19
20
21
# File 'lib/card/migration/import/merger.rb', line 12

def merge
  puts("nothing to merge") && return if @data.empty?

  Card::Mailer.perform_deliveries = false
  Card::Auth.as_bot do
    Card.merge_list @data, output_file: OUTPUT_FILE
  end

  update_import_data
end