Class: Fluent::ExceptionDetectorConfig::RuleTarget
- Inherits:
-
Object
- Object
- Fluent::ExceptionDetectorConfig::RuleTarget
- Defined in:
- lib/fluent/plugin/exception_detector.rb
Overview
Rule for a state transition: if pattern matches go to the given state.
Instance Attribute Summary collapse
-
#pattern ⇒ Object
Returns the value of attribute pattern.
-
#to_state ⇒ Object
Returns the value of attribute to_state.
Instance Method Summary collapse
- #==(other) ⇒ Object (also: #eql?)
- #hash ⇒ Object
-
#initialize(p, s) ⇒ RuleTarget
constructor
A new instance of RuleTarget.
- #state ⇒ Object
Constructor Details
#initialize(p, s) ⇒ RuleTarget
Returns a new instance of RuleTarget.
24 25 26 27 |
# File 'lib/fluent/plugin/exception_detector.rb', line 24 def initialize(p, s) @pattern = p @to_state = s end |
Instance Attribute Details
#pattern ⇒ Object
Returns the value of attribute pattern.
22 23 24 |
# File 'lib/fluent/plugin/exception_detector.rb', line 22 def pattern @pattern end |
#to_state ⇒ Object
Returns the value of attribute to_state.
22 23 24 |
# File 'lib/fluent/plugin/exception_detector.rb', line 22 def to_state @to_state end |
Instance Method Details
#==(other) ⇒ Object Also known as: eql?
29 30 31 |
# File 'lib/fluent/plugin/exception_detector.rb', line 29 def ==(other) other.class == self.class && other.state == state end |
#hash ⇒ Object
35 36 37 |
# File 'lib/fluent/plugin/exception_detector.rb', line 35 def hash state.hash end |
#state ⇒ Object
39 40 41 |
# File 'lib/fluent/plugin/exception_detector.rb', line 39 def state [@pattern, @to_state] end |