Class: Eco::API::UseCases::DefaultCases::EmailAsIdCase

Inherits:
Eco::API::UseCases::DefaultCase show all
Defined in:
lib/eco/api/usecases/default_cases/email_as_id_case.rb

Instance Method Summary collapse

Methods inherited from Eco::API::UseCases::DefaultCase

#initialize

Constructor Details

This class inherits a constructor from Eco::API::UseCases::DefaultCase

Instance Method Details

#processObject



7
8
9
10
11
12
13
14
15
16
17
# File 'lib/eco/api/usecases/default_cases/email_as_id_case.rb', line 7

def process
  @cases.define("email-as-id", type: :transform) do |people, session, options, usecase|
    job = session.job_group("main").new("update", usecase: usecase, type: :update, sets: :core)

    people.each do |person|
      person.external_id = person.email
      job.add(person)
    end

  end
end