Class: Fluent::EventRouter::Rule
- Inherits:
-
Object
- Object
- Fluent::EventRouter::Rule
- Defined in:
- lib/fluent/event_router.rb
Instance Attribute Summary collapse
-
#collector ⇒ Object
readonly
Returns the value of attribute collector.
-
#pattern_str ⇒ Object
readonly
Returns the value of attribute pattern_str.
Instance Method Summary collapse
-
#initialize(pattern, collector) ⇒ Rule
constructor
A new instance of Rule.
- #match?(tag) ⇒ Boolean
Constructor Details
#initialize(pattern, collector) ⇒ Rule
Returns a new instance of Rule.
58 59 60 61 62 63 64 65 66 67 |
# File 'lib/fluent/event_router.rb', line 58 def initialize(pattern, collector) patterns = pattern.split(/\s+/).map { |str| MatchPattern.create(str) } @pattern = if patterns.length == 1 patterns[0] else OrMatchPattern.new(patterns) end @pattern_str = pattern @collector = collector end |
Instance Attribute Details
#collector ⇒ Object (readonly)
Returns the value of attribute collector.
73 74 75 |
# File 'lib/fluent/event_router.rb', line 73 def collector @collector end |
#pattern_str ⇒ Object (readonly)
Returns the value of attribute pattern_str.
74 75 76 |
# File 'lib/fluent/event_router.rb', line 74 def pattern_str @pattern_str end |
Instance Method Details
#match?(tag) ⇒ Boolean
69 70 71 |
# File 'lib/fluent/event_router.rb', line 69 def match?(tag) @pattern.match(tag) end |