regexp.rb 524 B

123456789101112131415161718192021222324
  1. # Copyright (C) 2012-2022 Zammad Foundation, https://zammad-foundation.org/
  2. module Import
  3. class Zendesk
  4. module ObjectAttribute
  5. class Regexp < Import::Zendesk::ObjectAttribute::Base
  6. def init_callback(object_attribte)
  7. @data_option.merge!(
  8. type: 'text',
  9. maxlength: 255,
  10. regex: object_attribte.regexp_for_validation,
  11. )
  12. end
  13. private
  14. def data_type(_attribute)
  15. 'input'
  16. end
  17. end
  18. end
  19. end
  20. end