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-1.5.2-java lib/pacer/pipe/block_filter_pipe.rb
pacer-1.5.1-java lib/pacer/pipe/block_filter_pipe.rb
pacer-1.4.2-java lib/pacer/pipe/block_filter_pipe.rb
pacer-1.4.1-java lib/pacer/pipe/block_filter_pipe.rb
pacer-1.4.0-java lib/pacer/pipe/block_filter_pipe.rb
pacer-1.3.5-java lib/pacer/pipe/block_filter_pipe.rb
pacer-1.3.4-java lib/pacer/pipe/block_filter_pipe.rb
pacer-1.3.3-java lib/pacer/pipe/block_filter_pipe.rb
pacer-1.3.2-java lib/pacer/pipe/block_filter_pipe.rb
pacer-1.3.1-java lib/pacer/pipe/block_filter_pipe.rb
pacer-1.2.0-java lib/pacer/pipe/block_filter_pipe.rb
pacer-1.1.1-java lib/pacer/pipe/block_filter_pipe.rb
pacer-1.1.0-java lib/pacer/pipe/block_filter_pipe.rb