Class: Kernai::Recorder::Sink::Base
- Inherits:
-
Object
- Object
- Kernai::Recorder::Sink::Base
- Defined in:
- lib/kernai/recorder.rb
Overview
Abstract base declaring the full sink surface. Custom sinks can subclass this or simply implement ‘#record` on a plain object —both are accepted.
Direct Known Subclasses
Instance Method Summary collapse
- #clear! ⇒ Object
-
#entries ⇒ Object
A sink that does not materialise entries (e.g. a DB writer) returns an empty array so the Recorder’s query helpers stay safe to call but yield nothing.
- #record(_entry) ⇒ Object
Instance Method Details
#clear! ⇒ Object
35 36 37 |
# File 'lib/kernai/recorder.rb', line 35 def clear! # Default no-op end |
#entries ⇒ Object
A sink that does not materialise entries (e.g. a DB writer) returns an empty array so the Recorder’s query helpers stay safe to call but yield nothing.
31 32 33 |
# File 'lib/kernai/recorder.rb', line 31 def entries [] end |
#record(_entry) ⇒ Object
24 25 26 |
# File 'lib/kernai/recorder.rb', line 24 def record(_entry) raise NotImplementedError, "#{self.class}#record must be implemented" end |