Module: Snortor::RuleFinder

Included in:
RulefileCollection
Defined in:
lib/rule_finder.rb

Instance Method Summary collapse

Instance Method Details

#find_all_by_msg(title) ⇒ Object



14
15
16
17
18
19
20
21
22
23
# File 'lib/rule_finder.rb', line 14

def find_all_by_msg(title)
  res = []
  self.each do |rule|
    msg = rule.opts["msg"]
    if msg[title]
      res << rule 
    end
  end
  return res
end

#find_by_msg(title) ⇒ Object



3
4
5
6
7
8
9
10
11
12
# File 'lib/rule_finder.rb', line 3

def find_by_msg(title)
  self.each do |r|
    begin
      msg = r.opts["msg"]
      return r if msg[title]
    rescue
    end
  end
  return nil
end