module PatronusFati::MessageProcessor::Alert

Public Class Methods

process(obj) click to toggle source
# File lib/patronus_fati/message_processor/alert.rb, line 4
def self.process(obj)
  # Ignore the initial flood of cached data
  return unless PatronusFati.past_initial_flood?

  PatronusFati.event_handler.event(:alert, :new, process_obj(obj))

  nil
end
process_obj(obj) click to toggle source
# File lib/patronus_fati/message_processor/alert.rb, line 13
def self.process_obj(obj)
  {
    created_at: obj[:sec],
    type: obj[:header],
    message: obj[:text],

    source: obj[:source],
    destination: obj[:dest],
    other: obj[:other]
  }
end