Class: Datapipes::Sink
- Inherits:
-
Object
- Object
- Datapipes::Sink
- Includes:
- Composable
- Defined in:
- lib/datapipes/sink.rb
Overview
Build your own sink logic in ‘run` method.
Direct Known Subclasses
Instance Attribute Summary
Attributes included from Composable
Instance Method Summary collapse
Methods included from Composable
Instance Method Details
#accept?(data) ⇒ Boolean
11 12 13 |
# File 'lib/datapipes/sink.rb', line 11 def accept?(data) true end |
#run_all(data) ⇒ Object
6 7 8 9 |
# File 'lib/datapipes/sink.rb', line 6 def run_all(data) accumulated ||= [self] accumulated.each {|sink| sink.run(data) if sink.accept? data } end |