56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
|
# File 'lib/adaptation/base.rb', line 56
def process(xml_message)
message_type = xml_message[1..(xml_message.index(/(>| |\/)/) - 1)]
adaptor = message = nil
message_class = Adaptation::Message.get_class_object(message_type.capitalize)
message = message_class.nil? ? Adaptation::Message.new(xml_message) : message_class.new(xml_message)
adaptor_class = Adaptation::Adaptor.get_class_object("#{message_type.capitalize}Adaptor")
adaptor = adaptor_class.nil? ? ApplicationAdaptor.new : adaptor_class.new rescue Adaptation::Adaptor.new
unless message.valid?
@@logger.info "WARNING:Message doesn't validate!"
return
end
adaptor.process message
end
|