Class: MingleEvents::Processors::AuthorFilter
- Defined in:
- lib/mingle_events/processors/author_filter.rb
Overview
Removes all events from stream not triggered by the specified author
Defined Under Namespace
Classes: AuthorSpec
Instance Method Summary collapse
-
#initialize(spec, mingle_access, project_identifier) ⇒ AuthorFilter
constructor
A new instance of AuthorFilter.
- #match?(event) ⇒ Boolean
Methods inherited from Filter
Constructor Details
#initialize(spec, mingle_access, project_identifier) ⇒ AuthorFilter
Returns a new instance of AuthorFilter.
7 8 9 10 11 12 13 |
# File 'lib/mingle_events/processors/author_filter.rb', line 7 def initialize(spec, mingle_access, project_identifier) unless spec.size == 1 raise "Author spec must contain 1 and only 1 piece of criteria (the only legal criteria are each unique identifiers in and of themselves so multiple criteria is not needed.)" end @author_spec = AuthorSpec.new(spec, mingle_access, project_identifier) end |
Instance Method Details
#match?(event) ⇒ Boolean
15 16 17 |
# File 'lib/mingle_events/processors/author_filter.rb', line 15 def match?(event) @author_spec.event_triggered_by?(event) end |