Class: Stockboy::Filter Abstract
- Inherits:
-
Object
- Object
- Stockboy::Filter
- Defined in:
- lib/stockboy/filter.rb
Overview
This class is abstract.
Filters can be any callable object that returns true or false. This abstract class is a helpful way to define a commonly used filter pattern.
Interface
Filter subclasses must define a filter
method that returns true or false when called with the record context.
Direct Known Subclasses
Instance Method Summary collapse
-
#call(raw_context, translated_context) ⇒ Boolean
Return true to capture a filtered record, false to pass it on.
Instance Method Details
#call(raw_context, translated_context) ⇒ Boolean
Return true to capture a filtered record, false to pass it on
44 45 46 |
# File 'lib/stockboy/filter.rb', line 44 def call(raw_context, translated_context) return !!filter(raw_context, translated_context) end |