Sha256: 04bf88be48691c78acedfe52bd74a2202a92f373d355c8e77dc6d613a9931269

Contents?: true

Size: 566 Bytes

Versions: 1

Compression:

Stored size: 566 Bytes

Contents

# frozen_string_literal: true

module Dynamoid
  module AdapterPlugin
    class AwsSdkV3
      module Middleware
        class StartKey
          def initialize(next_chain)
            @next_chain = next_chain
          end

          def call(request)
            response = @next_chain.call(request)

            if response.last_evaluated_key
              request[:exclusive_start_key] = response.last_evaluated_key
            else
              throw :stop_pagination
            end

            response
          end
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
dynamoid-3.5.0 lib/dynamoid/adapter_plugin/aws_sdk_v3/middleware/start_key.rb