Class: MingleEvents::Processors::CategoryFilter
- Defined in:
- lib/mingle_events/processors/category_filter.rb
Overview
Removes events from the stream that do not match all of the specified categories
Instance Method Summary collapse
-
#initialize(categories) ⇒ CategoryFilter
constructor
A new instance of CategoryFilter.
- #match?(event) ⇒ Boolean
Methods inherited from Filter
Constructor Details
#initialize(categories) ⇒ CategoryFilter
Returns a new instance of CategoryFilter.
7 8 9 |
# File 'lib/mingle_events/processors/category_filter.rb', line 7 def initialize(categories) @categories = categories end |
Instance Method Details
#match?(event) ⇒ Boolean
11 12 13 |
# File 'lib/mingle_events/processors/category_filter.rb', line 11 def match?(event) @categories.all?{|c| event.categories.include?(c)} end |