Sha256: ef2bf44e01a367bc167d49dd80ad427e61c749d1b2abac6e2bb59c06baf0f68c

Contents?: true

Size: 501 Bytes

Versions: 33

Compression:

Stored size: 501 Bytes

Contents

module Pacer::Pipes
  class BlockFilterPipe < AbstractPipe
    field_reader :starts

    attr_reader :block, :invert

    def initialize(back, block, invert = false)
      super()
      @invert = invert
      @block = Pacer::Wrappers::WrappingPipeFunction.new back, block
    end

    def processNextStart()
      while raw_element = starts.next
        ok = block.call raw_element
        ok = !ok if invert
        return raw_element if ok
      end
      raise EmptyPipe.instance
    end
  end
end

Version data entries

33 entries across 33 versions & 1 rubygems

Version Path
pacer-2.0.24-java lib/pacer/pipe/block_filter_pipe.rb
pacer-2.0.22-java lib/pacer/pipe/block_filter_pipe.rb
pacer-2.0.20-java lib/pacer/pipe/block_filter_pipe.rb
pacer-2.0.19-java lib/pacer/pipe/block_filter_pipe.rb
pacer-2.0.18-java lib/pacer/pipe/block_filter_pipe.rb
pacer-2.0.17-java lib/pacer/pipe/block_filter_pipe.rb
pacer-2.0.16-java lib/pacer/pipe/block_filter_pipe.rb
pacer-2.0.15-java lib/pacer/pipe/block_filter_pipe.rb
pacer-2.0.14-java lib/pacer/pipe/block_filter_pipe.rb
pacer-2.0.13-java lib/pacer/pipe/block_filter_pipe.rb
pacer-2.0.12-java lib/pacer/pipe/block_filter_pipe.rb
pacer-2.0.10-java lib/pacer/pipe/block_filter_pipe.rb
pacer-2.0.10.pre-java lib/pacer/pipe/block_filter_pipe.rb
pacer-2.0.8-java lib/pacer/pipe/block_filter_pipe.rb
pacer-2.0.6-java lib/pacer/pipe/block_filter_pipe.rb
pacer-2.0.4.pre-java lib/pacer/pipe/block_filter_pipe.rb
pacer-2.0.0.pre-java lib/pacer/pipe/block_filter_pipe.rb
pacer-1.6.0-java lib/pacer/pipe/block_filter_pipe.rb
pacer-1.5.4-java lib/pacer/pipe/block_filter_pipe.rb
pacer-1.5.3-java lib/pacer/pipe/block_filter_pipe.rb