Sha256: d1bee5b96b64de79443ca744598681f1f20849a34313f79cebee54f8412a1605

Contents?: true

Size: 788 Bytes

Versions: 19

Compression:

Stored size: 788 Bytes

Contents

# frozen_string_literal: true

module Uploadcare
  module Param
    module Conversion
      module Document
        class ProcessingJobUrlBuilder
          class << self
            def call(uuid:, format: nil, page: nil)
              [
                uuid_part(uuid),
                format_part(format),
                page_part(page)
              ].compact.join('-')
            end

            private

            def uuid_part(uuid)
              "#{uuid}/document/"
            end

            def format_part(format)
              return if format.nil?

              "/format/#{format}/"
            end

            def page_part(page)
              return if page.nil?

              "/page/#{page}/"
            end
          end
        end
      end
    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
uploadcare-ruby-4.4.3 lib/uploadcare/param/conversion/document/processing_job_url_builder.rb
uploadcare-ruby-4.4.2 lib/uploadcare/param/conversion/document/processing_job_url_builder.rb
uploadcare-ruby-4.4.1 lib/uploadcare/param/conversion/document/processing_job_url_builder.rb
uploadcare-ruby-4.4.0 lib/uploadcare/param/conversion/document/processing_job_url_builder.rb
uploadcare-ruby-4.3.6 lib/uploadcare/param/conversion/document/processing_job_url_builder.rb
uploadcare-ruby-4.3.5 lib/uploadcare/param/conversion/document/processing_job_url_builder.rb
uploadcare-ruby-4.3.4 lib/uploadcare/param/conversion/document/processing_job_url_builder.rb
uploadcare-ruby-4.3.3 lib/uploadcare/param/conversion/document/processing_job_url_builder.rb
uploadcare-ruby-4.3.2 lib/uploadcare/param/conversion/document/processing_job_url_builder.rb
uploadcare-ruby-4.3.1 lib/uploadcare/param/conversion/document/processing_job_url_builder.rb
uploadcare-ruby-4.3.0 lib/uploadcare/param/conversion/document/processing_job_url_builder.rb
uploadcare-ruby-4.2.0 lib/uploadcare/param/conversion/document/processing_job_url_builder.rb
uploadcare-ruby-3.3.2 lib/uploadcare/param/conversion/document/processing_job_url_builder.rb
uploadcare-ruby-3.3.1 lib/uploadcare/param/conversion/document/processing_job_url_builder.rb
uploadcare-ruby-3.3.0 lib/uploadcare/param/conversion/document/processing_job_url_builder.rb
uploadcare-ruby-3.2.0 lib/uploadcare/param/conversion/document/processing_job_url_builder.rb
uploadcare-ruby-3.1.1 lib/uploadcare/param/conversion/document/processing_job_url_builder.rb
uploadcare-ruby-3.1.0 lib/uploadcare/param/conversion/document/processing_job_url_builder.rb
uploadcare-ruby-3.1.0.pre.rc1 lib/uploadcare/param/conversion/document/processing_job_url_builder.rb