Class: AwsAlertMonitor::EventClassifier

Inherits:
Object
  • Object
show all
Defined in:
lib/aws-alert-monitor/event_classifier.rb

Instance Method Summary collapse

Constructor Details

#initialize(message) ⇒ EventClassifier

Returns a new instance of EventClassifier.



5
6
7
# File 'lib/aws-alert-monitor/event_classifier.rb', line 5

def initialize(message)
  @message = message
end

Instance Method Details

#eventObject



9
10
11
12
13
14
15
# File 'lib/aws-alert-monitor/event_classifier.rb', line 9

def event
  event_subjects_classes.each do |subject, klass|
    return klass.new(@message) if generic_event_subject =~ subject
  end

  unknown_event_class.new @message
end