Class: FilterChain::Filter
- Inherits:
-
Object
- Object
- FilterChain::Filter
- Defined in:
- lib/filter_chain/filter.rb
Direct Known Subclasses
Collector, DeflateFilter, DemultiplexFilter, DeserializeFilter, InflateFilter, MultiplexFilter, ProcFilter, SerializeFilter, Terminator
Instance Attribute Summary collapse
-
#block ⇒ Object
readonly
Returns the value of attribute block.
-
#next_filter ⇒ Object
Returns the value of attribute next_filter.
-
#opts ⇒ Object
readonly
Returns the value of attribute opts.
Instance Method Summary collapse
- #<<(data) ⇒ Object
-
#initialize(opts = {}, &block) ⇒ Filter
constructor
A new instance of Filter.
- #pass(data) ⇒ Object
Constructor Details
#initialize(opts = {}, &block) ⇒ Filter
Returns a new instance of Filter.
8 9 10 11 12 |
# File 'lib/filter_chain/filter.rb', line 8 def initialize(opts = {}, &block) @opts = opts @block = block on_initialize end |
Instance Attribute Details
#block ⇒ Object (readonly)
Returns the value of attribute block.
4 5 6 |
# File 'lib/filter_chain/filter.rb', line 4 def block @block end |
#next_filter ⇒ Object
Returns the value of attribute next_filter.
6 7 8 |
# File 'lib/filter_chain/filter.rb', line 6 def next_filter @next_filter end |
#opts ⇒ Object (readonly)
Returns the value of attribute opts.
3 4 5 |
# File 'lib/filter_chain/filter.rb', line 3 def opts @opts end |
Instance Method Details
#<<(data) ⇒ Object
14 15 16 |
# File 'lib/filter_chain/filter.rb', line 14 def <<(data) on_input(data) end |
#pass(data) ⇒ Object
18 19 20 |
# File 'lib/filter_chain/filter.rb', line 18 def pass(data) next_filter ? next_filter << data : data end |