Class: FilterChain::Filter
- Inherits:
-
Object
- Object
- FilterChain::Filter
- Defined in:
- lib/filter_chain/filter.rb
Direct Known Subclasses
Collector, DeflateFilter, DeserializeFilter, InflateFilter, ProcFilter, SerializeFilter, SplitHeaderFilter, UnsplitHeaderFilter
Instance Attribute Summary collapse
-
#next_filter ⇒ Object
Returns the value of attribute next_filter.
-
#opts ⇒ Object
readonly
Returns the value of attribute opts.
Instance Method Summary collapse
-
#initialize(opts = {}) ⇒ Filter
constructor
A new instance of Filter.
- #input(data) ⇒ Object
- #pass(data) ⇒ Object
Constructor Details
#initialize(opts = {}) ⇒ Filter
Returns a new instance of Filter.
7 8 9 10 |
# File 'lib/filter_chain/filter.rb', line 7 def initialize(opts = {}) @opts = opts on_initialize end |
Instance Attribute Details
#next_filter ⇒ Object
Returns the value of attribute next_filter.
5 6 7 |
# File 'lib/filter_chain/filter.rb', line 5 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
#input(data) ⇒ Object
12 13 14 15 16 |
# File 'lib/filter_chain/filter.rb', line 12 def input(data) on_input(data) nil end |
#pass(data) ⇒ Object
18 19 20 21 22 |
# File 'lib/filter_chain/filter.rb', line 18 def pass(data) raise NextFilterMissing unless next_filter next_filter.input(data) end |