normalize_entry.rb 441 B

12345678910111213141516
  1. # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. class Sequencer::Unit::Import::Ldap::User::NormalizeEntry < Sequencer::Unit::Base
  3. uses :resource
  4. provides :resource
  5. def process
  6. state.provide(:resource) do
  7. empty = ActiveSupport::HashWithIndifferentAccess.new
  8. resource.each_with_object(empty) do |(key, values), normalized|
  9. normalized[key] = values.first
  10. end
  11. end
  12. end
  13. end