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.



56
57
58
59
60
61
62
63
64
65
# File 'lib/fluent/event_router.rb', line 56

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.



71
72
73
# File 'lib/fluent/event_router.rb', line 71

def collector
  @collector
end

#pattern_strObject (readonly)

Returns the value of attribute pattern_str.



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

def pattern_str
  @pattern_str
end

Instance Method Details

#match?(tag) ⇒ Boolean

Returns:

  • (Boolean)


67
68
69
# File 'lib/fluent/event_router.rb', line 67

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