Class: Sawmill::EntryClassifier
- Inherits:
-
Object
- Object
- Sawmill::EntryClassifier
- Defined in:
- lib/sawmill/entry_classifier.rb
Overview
An object that classifies log entry objects, calling the proper methods on a Sawmill::EntryProcessor.
Instance Method Summary collapse
-
#entry(entry_) ⇒ Object
Call this method to classify a log entry and send it to the processor.
-
#initialize(processor_) ⇒ EntryClassifier
constructor
Create a classifier that sends entries to the given Sawmill::EntryProcessor.
Constructor Details
#initialize(processor_) ⇒ EntryClassifier
Create a classifier that sends entries to the given Sawmill::EntryProcessor.
49 50 51 |
# File 'lib/sawmill/entry_classifier.rb', line 49 def initialize(processor_) @processor = processor_ end |
Instance Method Details
#entry(entry_) ⇒ Object
Call this method to classify a log entry and send it to the processor.
56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
# File 'lib/sawmill/entry_classifier.rb', line 56 def entry(entry_) case entry_.type when :unknown_data @processor.unknown_data(entry_) when :begin_record @processor.begin_record(entry_) when :end_record @processor.end_record(entry_) when :message @processor.(entry_) when :attribute @processor.attribute(entry_) end end |