Class: Threshold::Suppression
- Inherits:
-
Object
- Object
- Threshold::Suppression
- Includes:
- Comparable, Standalone
- Defined in:
- lib/threshold/suppression.rb
Instance Attribute Summary collapse
-
#comment ⇒ Object
Returns the value of attribute comment.
-
#gid ⇒ Object
Returns the value of attribute gid.
-
#ip ⇒ Object
Returns the value of attribute ip.
-
#sid ⇒ Object
Returns the value of attribute sid.
-
#track_by ⇒ Object
Returns the value of attribute track_by.
Instance Method Summary collapse
-
#initialize(line = "") ⇒ Suppression
constructor
A new instance of Suppression.
- #to_s(skip = false) ⇒ Object
Methods included from Standalone
Constructor Details
#initialize(line = "") ⇒ Suppression
Returns a new instance of Suppression.
50 51 52 |
# File 'lib/threshold/suppression.rb', line 50 def initialize(line="") transform(line) unless line.empty? end |
Instance Attribute Details
#comment ⇒ Object
Returns the value of attribute comment.
44 45 46 |
# File 'lib/threshold/suppression.rb', line 44 def comment @comment end |
#gid ⇒ Object
Returns the value of attribute gid.
44 45 46 |
# File 'lib/threshold/suppression.rb', line 44 def gid @gid end |
#ip ⇒ Object
Returns the value of attribute ip.
44 45 46 |
# File 'lib/threshold/suppression.rb', line 44 def ip @ip end |
#sid ⇒ Object
Returns the value of attribute sid.
44 45 46 |
# File 'lib/threshold/suppression.rb', line 44 def sid @sid end |
#track_by ⇒ Object
Returns the value of attribute track_by.
44 45 46 |
# File 'lib/threshold/suppression.rb', line 44 def track_by @track_by end |
Instance Method Details
#to_s(skip = false) ⇒ Object
54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 |
# File 'lib/threshold/suppression.rb', line 54 def to_s(skip = false) if self.valid? if track_by == nil then if comment?(skip) "suppress gen_id #{@gid}, sig_id #{@sid} #{@comment}" else "suppress gen_id #{@gid}, sig_id #{@sid}" end else if comment?(skip) "suppress gen_id #{@gid}, sig_id #{@sid}, track by_#{@track_by}, ip #{@ip} #{@comment}" else "suppress gen_id #{@gid}, sig_id #{@sid}, track by_#{@track_by}, ip #{@ip}" end end else raise InvalidSuppressionObject, 'Suppression did not validate' end end |