Class: Snort::Rule
- Inherits:
-
Object
- Object
- Snort::Rule
- Defined in:
- lib/rule.rb
Overview
this class is extended to have activation ability of single rules
Instance Attribute Summary collapse
-
#active ⇒ Object
Returns the value of attribute active.
-
#line ⇒ Object
Returns the value of attribute line.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(kwargs = {}) ⇒ Rule
constructor
A new instance of Rule.
- #message ⇒ Object
- #to_line ⇒ Object
Constructor Details
#initialize(kwargs = {}) ⇒ Rule
Returns a new instance of Rule.
10 11 12 13 |
# File 'lib/rule.rb', line 10 def initialize(kwargs={}) super(kwargs) @active=true end |
Instance Attribute Details
#active ⇒ Object
Returns the value of attribute active.
6 7 8 |
# File 'lib/rule.rb', line 6 def active @active end |
#line ⇒ Object
Returns the value of attribute line.
7 8 9 |
# File 'lib/rule.rb', line 7 def line @line end |
Class Method Details
.parse_rule(line) ⇒ Object
22 23 24 25 26 27 28 29 30 |
# File 'lib/rule.rb', line 22 def self.parse_rule(line) rule = self.parse(line) if rule. rule.line = line return rule else return nil end end |
Instance Method Details
#message ⇒ Object
19 20 21 |
# File 'lib/rule.rb', line 19 def opts['msg'] end |
#to_line ⇒ Object
32 33 34 |
# File 'lib/rule.rb', line 32 def to_line @line.to_s end |