Sha256: 7b3e79e8ca23c9828825dfd77f44dc8e9c8b364d67ccb4d75fd1ef83ac948f32

Contents?: true

Size: 611 Bytes

Versions: 10

Compression:

Stored size: 611 Bytes

Contents

module Grim
  class MultiProcessor
    def initialize(processors)
      @processors = processors
    end

    def count(path)
      result = ""
      @processors.each do |processor|
        result = processor.count(path)
        break if result != ""
      end
      result
    end

    def save(pdf, index, path, options)
      result = true
      @processors.each do |processor|
        begin
          result = processor.save(pdf, index, path, options)
        rescue UnprocessablePage
          next
        end
        break if result
      end
      raise UnprocessablePage unless result
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
grim-1.3.5 lib/grim/multi_processor.rb
grim-1.3.4 lib/grim/multi_processor.rb
grim-1.3.3 lib/grim/multi_processor.rb
grim-1.3.2 lib/grim/multi_processor.rb
grim-1.3.1 lib/grim/multi_processor.rb
grim-1.3.0 lib/grim/multi_processor.rb
grim-1.2.0 lib/grim/multi_processor.rb
grim-1.1.0 lib/grim/multi_processor.rb
grim-1.0.0 lib/grim/multi_processor.rb
grim-0.3.0 lib/grim/multi_processor.rb