trabajo-afectivo/lib/import/otrs/helper.rb

34 lines
660 B
Ruby
Raw Permalink Normal View History

2022-01-01 13:38:12 +00:00
# Copyright (C) 2012-2022 Zammad Foundation, https://zammad-foundation.org/
module Import
module OTRS
module Helper
extend self
private
def from_mapping(record)
result = {}
# use the mapping of the class in which
# this module gets extended
self.class::MAPPING.each do |key_sym, value|
key = key_sym.to_s
next if !record.key?(key)
result[value] = record[key]
end
result
end
def active?(record)
case record['ValidID'].to_s
when '3', '2', '0'
false
else
true
end
end
end
end
end