Module: FLV::Edit::Processor::Filter

Included in:
Cut, Debug, Print
Defined in:
lib/flvedit/processor/filter.rb

Overview

Basic processors can include Filter which provides a pretty simple #each. It will call #before_filter then #filter(chunk) for each chunk. If #filter returns :skip, the chunk won’t be yielded #filter can also stops altogether the processing of the current source by calling #stop.

Instance Method Summary collapse

Instance Method Details

#eachObject



13
14
15
16
17
18
19
20
21
# File 'lib/flvedit/processor/filter.rb', line 13

def each
  return to_enum unless block_given?
  before_filter
  catch :stop do
    super do |chunk|
      yield chunk unless filter(chunk) == :skip
    end
  end
end