Module: PatronusFati::MessageProcessor::Alert

Includes:
PatronusFati::MessageProcessor
Defined in:
lib/patronus_fati/message_processor/alert.rb

Class Method Summary collapse

Methods included from PatronusFati::MessageProcessor

cleanup_models, close_inactive_connections, handle, ignored_types, offline_access_points, offline_clients, periodic_flush

Methods included from FactoryBase

#class_to_name, #factory, #ignored_types, #included, #registered_factories

Class Method Details

.process(obj) ⇒ void



4
5
6
7
8
9
10
11
# 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) ⇒ void



13
14
15
16
17
18
19
20
21
22
23
# 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