Sha256: 553adf4d9e435a2ae03d9f6e47e36a65118fcfbc4cef032fb41dbc7f7ee5395f

Contents?: true

Size: 449 Bytes

Versions: 18

Compression:

Stored size: 449 Bytes

Contents

module Wukong
  module Streamer
    #
    # emit only some records, as dictated by the #emit? method
    #
    # This is a mixin: including this module in your streamer
    # implements its +#process+ method.
    #
    module Filter
      #
      # Filter out a subset of record/lines
      #
      # Subclass and re-define the emit? method
      #
      def process *record, &block
        yield record if emit?(record)
      end
    end
  end
end

Version data entries

18 entries across 18 versions & 2 rubygems

Version Path
mrflip-wukong-0.1.0 lib/wukong/streamer/filter.rb
wukong-1.5.4 lib/wukong/streamer/filter.rb
wukong-1.5.3 lib/wukong/streamer/filter.rb
wukong-1.5.2 lib/wukong/streamer/filter.rb
wukong-1.5.1 lib/wukong/streamer/filter.rb
wukong-1.5.0 lib/wukong/streamer/filter.rb
wukong-1.4.12 lib/wukong/streamer/filter.rb
wukong-1.4.11 lib/wukong/streamer/filter.rb
wukong-1.4.10 lib/wukong/streamer/filter.rb
wukong-1.4.9 lib/wukong/streamer/filter.rb
wukong-1.4.7 lib/wukong/streamer/filter.rb
wukong-1.4.6 lib/wukong/streamer/filter.rb
wukong-1.4.5 lib/wukong/streamer/filter.rb
wukong-1.4.2 lib/wukong/streamer/filter.rb
wukong-1.4.1 lib/wukong/streamer/filter.rb
wukong-1.4.0 lib/wukong/streamer/filter.rb
wukong-0.1.4 lib/wukong/streamer/filter.rb
wukong-0.1.1 lib/wukong/streamer/filter.rb