Class: Fluent::ExceptionDetectorConfig::RuleTarget

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

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

#patternObject

Returns the value of attribute pattern.



22
23
24
# File 'lib/fluent/plugin/exception_detector.rb', line 22

def pattern
  @pattern
end

#to_stateObject

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

#hashObject



35
36
37
# File 'lib/fluent/plugin/exception_detector.rb', line 35

def hash
  state.hash
end

#stateObject



39
40
41
# File 'lib/fluent/plugin/exception_detector.rb', line 39

def state
  [@pattern, @to_state]
end