Class: Dynamoid::AdapterPlugin::AwsSdkV3::Middleware::StartKey

Inherits:
Object
  • Object
show all
Defined in:
lib/dynamoid/adapter_plugin/aws_sdk_v3/middleware/start_key.rb

Instance Method Summary collapse

Constructor Details

#initialize(next_chain) ⇒ StartKey

Returns a new instance of StartKey.



9
10
11
# File 'lib/dynamoid/adapter_plugin/aws_sdk_v3/middleware/start_key.rb', line 9

def initialize(next_chain)
  @next_chain = next_chain
end

Instance Method Details

#call(request) ⇒ Object



13
14
15
16
17
18
19
20
21
22
23
# File 'lib/dynamoid/adapter_plugin/aws_sdk_v3/middleware/start_key.rb', line 13

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