Class: Wukong::Processor::Filter
- Inherits:
-
Wukong::Processor
- Object
- Hanuman::Stage
- Wukong::Processor
- Wukong::Processor::Filter
- Defined in:
- lib/wukong/widget/filters.rb
Overview
A widget which filters input records according to some criterion.
Constant Summary
Constants inherited from Wukong::Processor
Instance Method Summary collapse
-
#process(record) {|record| ... } ⇒ Object
Process a
record
by yielding it only if it should be selected by this filter. -
#reject?(record) ⇒ true, false
Should the given
record
be rejected by this filter?. -
#select?(record) ⇒ true, false
Should the given
record
be passed by this filter?.
Methods inherited from Wukong::Processor
configure, consumes, description, #expected_record_type, #expected_serialization, #finalize, #perform_action, produces, #receive_action, #setup, #stop, valid_serializer?, validate_and_set_serialization
Methods included from Logging
Methods included from Hanuman::StageClassMethods
#builder, #label, #register, #set_builder
Instance Method Details
#process(record) {|record| ... } ⇒ Object
Process a record
by yielding it only if it should be
selected by this filter.
20 21 22 |
# File 'lib/wukong/widget/filters.rb', line 20 def process(record) yield(record) if select?(record) end |
#reject?(record) ⇒ true, false
Should the given record
be rejected by this filter?
38 39 40 |
# File 'lib/wukong/widget/filters.rb', line 38 def reject?(record) not select?(record) end |
#select?(record) ⇒ true, false
Should the given record
be passed by this filter?
29 30 31 |
# File 'lib/wukong/widget/filters.rb', line 29 def select?(record) true end |