Class: Fluent::EventRouter::Rule

Inherits:
Object
  • Object
show all
Defined in:
lib/fluent/event_router.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#collectorObject (readonly)

Returns the value of attribute collector.



73
74
75
# File 'lib/fluent/event_router.rb', line 73

def collector
  @collector
end

#pattern_strObject (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

Returns:

  • (Boolean)


69
70
71
# File 'lib/fluent/event_router.rb', line 69

def match?(tag)
  @pattern.match(tag)
end