Class: Threshold::RateFilter
- Inherits:
-
Object
- Object
- Threshold::RateFilter
- Includes:
- Comparable, Standalone
- Defined in:
- lib/threshold/rate_filter.rb
Instance Attribute Summary collapse
-
#apply_to ⇒ Object
Returns the value of attribute apply_to.
-
#comment ⇒ Object
Returns the value of attribute comment.
-
#count ⇒ Object
Returns the value of attribute count.
-
#gid ⇒ Object
Returns the value of attribute gid.
-
#new_action ⇒ Object
Returns the value of attribute new_action.
-
#seconds ⇒ Object
Returns the value of attribute seconds.
-
#sid ⇒ Object
Returns the value of attribute sid.
-
#timeout ⇒ Object
Returns the value of attribute timeout.
-
#track_by ⇒ Object
Returns the value of attribute track_by.
Instance Method Summary collapse
-
#initialize(line = "") ⇒ RateFilter
constructor
A new instance of RateFilter.
- #to_s(skip = false) ⇒ Object
Methods included from Standalone
Constructor Details
#initialize(line = "") ⇒ RateFilter
Returns a new instance of RateFilter.
106 107 108 |
# File 'lib/threshold/rate_filter.rb', line 106 def initialize(line="") transform(line) unless line.empty? end |
Instance Attribute Details
#apply_to ⇒ Object
Returns the value of attribute apply_to.
100 101 102 |
# File 'lib/threshold/rate_filter.rb', line 100 def apply_to @apply_to end |
#comment ⇒ Object
Returns the value of attribute comment.
100 101 102 |
# File 'lib/threshold/rate_filter.rb', line 100 def comment @comment end |
#count ⇒ Object
Returns the value of attribute count.
100 101 102 |
# File 'lib/threshold/rate_filter.rb', line 100 def count @count end |
#gid ⇒ Object
Returns the value of attribute gid.
100 101 102 |
# File 'lib/threshold/rate_filter.rb', line 100 def gid @gid end |
#new_action ⇒ Object
Returns the value of attribute new_action.
100 101 102 |
# File 'lib/threshold/rate_filter.rb', line 100 def new_action @new_action end |
#seconds ⇒ Object
Returns the value of attribute seconds.
100 101 102 |
# File 'lib/threshold/rate_filter.rb', line 100 def seconds @seconds end |
#sid ⇒ Object
Returns the value of attribute sid.
100 101 102 |
# File 'lib/threshold/rate_filter.rb', line 100 def sid @sid end |
#timeout ⇒ Object
Returns the value of attribute timeout.
100 101 102 |
# File 'lib/threshold/rate_filter.rb', line 100 def timeout @timeout end |
#track_by ⇒ Object
Returns the value of attribute track_by.
100 101 102 |
# File 'lib/threshold/rate_filter.rb', line 100 def track_by @track_by end |
Instance Method Details
#to_s(skip = false) ⇒ Object
110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 |
# File 'lib/threshold/rate_filter.rb', line 110 def to_s(skip = false) if self.valid? if apply_to == nil then if comment?(skip) "rate_filter gen_id #{@gid}, sig_id #{@sid}, track by_#{@track_by}, count #{@count}, seconds #{@seconds}, new_action #{@new_action}, timeout #{@timeout} #{@comment}" else "rate_filter gen_id #{@gid}, sig_id #{@sid}, track by_#{@track_by}, count #{@count}, seconds #{@seconds}, new_action #{@new_action}, timeout #{@timeout}" end else if comment?(skip) "rate_filter gen_id #{@gid}, sig_id #{@sid}, count #{@count}, seconds #{@seconds}, new_action #{@new_action}, timeout #{@timeout} apply_to #{@apply_to} #{@comment}" else "rate_filter gen_id #{@gid}, sig_id #{@sid}, count #{@count}, seconds #{@seconds}, new_action #{@new_action}, timeout #{@timeout} apply_to #{@apply_to}" end end else raise InvalidRateFilterObject, 'Rate Filter did not validate' end end |