Method: Turbine::Pipeline::JournalFilter#initialize

Defined in:
lib/turbine/pipeline/journal_filter.rb

#initialize(mode, name) ⇒ JournalFilter

Public: Creates a new JournalFilter.

mode - The filter mode to be used. :only will cause the filter to emit

only values which were seen in the journal, while :except will
emit only those which were *not* seen.

name - The name of the Journal whose values will be used.

Returns a JournalFilter.



16
17
18
19
20
21
22
23
24
25
# File 'lib/turbine/pipeline/journal_filter.rb', line 16

def initialize(mode, name)
  unless mode == :only || mode == :except
    raise ArgumentError, 'JournalFilter mode must be :only or :except'
  end

  @mode = mode
  @journal_name = name

  super(&method(:"filter_#{ mode }"))
end