Class: Dynamodb::Api::Scan

Inherits:
Base
  • Object
show all
Defined in:
lib/dynamodb/api/scan.rb

Overview

:nodoc:

Instance Attribute Summary

Attributes inherited from Base

#last_evaluated_key

Attributes included from Relation

#attr_expression_attribute, #filter_clause, #from_clause, #index_clause, #limit_clause, #order_clause, #select_clause, #where_clause

Instance Method Summary collapse

Methods included from Relation

#expression_attribute

Methods included from Relation::QueryMethods

#filter, #from, #index, #limit, #order, #select, #where

Instance Method Details

#allObject



8
9
10
11
12
# File 'lib/dynamodb/api/scan.rb', line 8

def all
  result = Adapter.client.scan(build_input)
  @last_evaluated_key = result.last_evaluated_key
  result
end

#nextObject



14
15
16
17
18
19
20
21
# File 'lib/dynamodb/api/scan.rb', line 14

def next
  return nil if @last_evaluated_key.blank?
  input = build_input
  input[:exclusive_start_key] = @last_evaluated_key
  result = Adapter.client.scan(input)
  @last_evaluated_key = result.last_evaluated_key
  result
end