Sha256: 5ce977437f8aa80813fe5ef3481f05b64087ed3d8e9a2fc680a3037a810651b3

Contents?: true

Size: 859 Bytes

Versions: 33

Compression:

Stored size: 859 Bytes

Contents

module Pacer
  module Routes
    module RouteOperations
      def process(opts = {}, &block)
        chain_route({:transform => :process, :block => block}.merge(opts))
      end
    end
  end

  module Transform
    module Process
      attr_accessor :block

      def help(section = nil)
        case section
        when nil
          puts <<HELP
The process method executes the given block for each element that is
passed through the route. After the block is called, the element that
was passed to it is emitted to be handled by the next step in the route.

It is Pacer's lazy version of the #each method.

HELP
        else
          super
        end
      end
      protected

      def attach_pipe(end_pipe)
        pipe = Pacer::Pipes::ProcessPipe.new(back, block)
        pipe.setStarts end_pipe if end_pipe
        pipe
      end
    end
  end
end

Version data entries

33 entries across 33 versions & 1 rubygems

Version Path
pacer-1.5.2-java lib/pacer/transform/process.rb
pacer-1.5.1-java lib/pacer/transform/process.rb
pacer-1.4.2-java lib/pacer/transform/process.rb
pacer-1.4.1-java lib/pacer/transform/process.rb
pacer-1.4.0-java lib/pacer/transform/process.rb
pacer-1.3.5-java lib/pacer/transform/process.rb
pacer-1.3.4-java lib/pacer/transform/process.rb
pacer-1.3.3-java lib/pacer/transform/process.rb
pacer-1.3.2-java lib/pacer/transform/process.rb
pacer-1.3.1-java lib/pacer/transform/process.rb
pacer-1.2.0-java lib/pacer/transform/process.rb
pacer-1.1.1-java lib/pacer/transform/process.rb
pacer-1.1.0-java lib/pacer/transform/process.rb