remote_id.rb 475 B

12345678910111213141516171819202122
  1. # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. class Sequencer::Unit::Import::Common::Model::Attributes::RemoteId < Sequencer::Unit::Base
  3. include ::Sequencer::Unit::Import::Common::Model::Mixin::HandleFailure
  4. uses :resource
  5. provides :remote_id
  6. def process
  7. state.provide(:remote_id) do
  8. resource.fetch(attribute).dup.to_s
  9. end
  10. rescue KeyError => e
  11. handle_failure(e)
  12. end
  13. private
  14. def attribute
  15. :id
  16. end
  17. end