Sha256: b5d935dd6922cc5a73078be9f3cde1509996e80f574d0e6f94034ee714984d6b

Contents?: true

Size: 536 Bytes

Versions: 20

Compression:

Stored size: 536 Bytes

Contents

require "tempfile"

module RocketJob
  module Sliced
    class Output < Slices
      def download(header_line: nil)
        raise(ArgumentError, "Block is mandatory") unless block_given?

        # Write the header line
        yield(header_line) if header_line

        # Call the supplied block for every record returned
        record_count = 0
        each do |slice|
          slice.each do |record|
            record_count += 1
            yield(record)
          end
        end
        record_count
      end
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
rocketjob-6.1.0 lib/rocket_job/sliced/output.rb
rocketjob-6.0.3 lib/rocket_job/sliced/output.rb
rocketjob-6.0.2 lib/rocket_job/sliced/output.rb
rocketjob-6.0.1 lib/rocket_job/sliced/output.rb
rocketjob-6.0.0 lib/rocket_job/sliced/output.rb
rocketjob-6.0.0.rc3 lib/rocket_job/sliced/output.rb
rocketjob-6.0.0.rc2 lib/rocket_job/sliced/output.rb
rocketjob-6.0.0.rc1 lib/rocket_job/sliced/output.rb
rocketjob-5.4.1 lib/rocket_job/sliced/output.rb
rocketjob-5.4.0 lib/rocket_job/sliced/output.rb
rocketjob-5.4.0.beta2 lib/rocket_job/sliced/output.rb
rocketjob-5.4.0.beta1 lib/rocket_job/sliced/output.rb
rocketjob-5.3.3 lib/rocket_job/sliced/output.rb
rocketjob-5.3.2 lib/rocket_job/sliced/output.rb
rocketjob-5.3.1 lib/rocket_job/sliced/output.rb
rocketjob-5.3.0 lib/rocket_job/sliced/output.rb
rocketjob-5.2.0 lib/rocket_job/sliced/output.rb
rocketjob-5.2.0.beta3 lib/rocket_job/sliced/output.rb
rocketjob-5.2.0.beta2 lib/rocket_job/sliced/output.rb
rocketjob-5.2.0.beta1 lib/rocket_job/sliced/output.rb