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.
Direct Known Subclasses
Compact, Head, Identity, Limit, Null, RegexpFilter, Reject, Sample, Select, Tail
Constant Summary
Constants inherited from Wukong::Processor
Instance Attribute Summary
Attributes included from Hanuman::StageInstanceMethods
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, description, #finalize, #perform_action, #receive_action, #setup, #stop
Methods included from Logging
Methods inherited from Hanuman::Stage
Methods included from Hanuman::StageClassMethods
#builder, #label, #register, #set_builder
Methods included from Hanuman::StageInstanceMethods
#add_link, #linkable_name, #root
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 |