backend.rb 573 B

12345678910111213141516171819202122232425262728
  1. # Copyright (C) 2012-2023 Zammad Foundation, https://zammad-foundation.org/
  2. class CoreWorkflow::Condition::Backend
  3. def initialize(condition_object:, key:, condition:, value:)
  4. @key = key
  5. @condition_object = condition_object
  6. @condition = condition
  7. @value = value
  8. end
  9. attr_reader :value
  10. def field
  11. @key.sub(%r{.*\.}, '')
  12. end
  13. def object?(object)
  14. @condition_object.attributes.instance_of?(object)
  15. end
  16. def condition_value
  17. Array(@condition['value']).map(&:to_s)
  18. end
  19. def match
  20. false
  21. end
  22. end