Class: Fluent::Match
- Inherits:
-
Object
- Object
- Fluent::Match
- Defined in:
- lib/fluent/match.rb
Instance Attribute Summary collapse
-
#output ⇒ Object
readonly
Returns the value of attribute output.
Instance Method Summary collapse
- #emit(tag, es) ⇒ Object
-
#initialize(pattern_str, output) ⇒ Match
constructor
A new instance of Match.
- #match(tag) ⇒ Object
- #shutdown ⇒ Object
- #start ⇒ Object
Constructor Details
#initialize(pattern_str, output) ⇒ Match
Returns a new instance of Match.
19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/fluent/match.rb', line 19 def initialize(pattern_str, output) patterns = pattern_str.split(/\s+/).map {|str| MatchPattern.create(str) } if patterns.length == 1 @pattern = patterns[0] else @pattern = OrMatchPattern.new(patterns) end @output = output end |
Instance Attribute Details
#output ⇒ Object (readonly)
Returns the value of attribute output.
31 32 33 |
# File 'lib/fluent/match.rb', line 31 def output @output end |
Instance Method Details
#emit(tag, es) ⇒ Object
33 34 35 36 |
# File 'lib/fluent/match.rb', line 33 def emit(tag, es) chain = NullOutputChain.instance @output.emit(tag, es, chain) end |
#match(tag) ⇒ Object
46 47 48 49 50 51 |
# File 'lib/fluent/match.rb', line 46 def match(tag) if @pattern.match(tag) return true end return false end |
#shutdown ⇒ Object
42 43 44 |
# File 'lib/fluent/match.rb', line 42 def shutdown @output.shutdown end |
#start ⇒ Object
38 39 40 |
# File 'lib/fluent/match.rb', line 38 def start @output.start end |