Class: Plumbing::Pipe::CustomFilter
- Inherits:
-
Plumbing::Pipe
- Object
- Plumbing::Pipe
- Plumbing::Pipe::CustomFilter
- Defined in:
- lib/plumbing/pipe/custom_filter.rb
Overview
A pipe that can be subclassed to filter events from a source pipe
Direct Known Subclasses
Instance Method Summary collapse
-
#initialize(source:) ⇒ CustomFilter
constructor
Chain this pipe to the source pipe.
Methods inherited from Plumbing::Pipe
#add_observer, #is_observer?, #notify, #remove_observer, #shutdown
Methods included from Actor
#in_context?, included, #safely, #stop, timeout, transporter
Constructor Details
#initialize(source:) ⇒ CustomFilter
Chain this pipe to the source pipe
6 7 8 9 10 11 |
# File 'lib/plumbing/pipe/custom_filter.rb', line 6 def initialize source: super() source.as(Observable).add_observer do |event_name, data| received event_name, data end end |