toy-dynamo 0.1.11 → 0.1.12

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e0d240d12434aa397f5c205cb40cd9a71e8a1918
4
- data.tar.gz: dd7a10a62c13139d765667acbcf57430e0c5811e
3
+ metadata.gz: 93ec8909dee1398552fd8a1b494c58a76f08cb46
4
+ data.tar.gz: 9c82f7a4e2e13c4bc1085967891861be7e87ff5b
5
5
  SHA512:
6
- metadata.gz: 392db89be0b3e2b41daddbf8c4d376dc82e7856d2a7a4bd079abdc9793b9457e94e49c91d7625f9a3190f82e1c2372e65966815c99fe0d7a52b7f5152db1ac01
7
- data.tar.gz: a6980b0a9134bac9435f221bcdc8914bb14152354e6b88a76f227cb82e7b3def2cd34faa36c781938f9b9093c981631cce275d6a83e11cd531d3ab7cf8c064d1
6
+ metadata.gz: 53116c844ba3aaf35e63a474316769014172517f154aa1d5d9afa097d4627ece97bd275a3027efaf96291f01a7a392508e083434f1ff28c424e477e5632d105e
7
+ data.tar.gz: 9199026688e1410dd7a6775f1797b7b2e55c74194651ec8d7ec6bc9e6b4f3033bb448ee1568ff04fb6bc891097f60b051b73ef07b19a3ecc0205673396b53acb
@@ -17,6 +17,8 @@ module Toy
17
17
  raise ArgumentError, "no range_key specified for this table" if dynamo_table.range_keys.blank? && global_secondary_indexes.blank?
18
18
  aggregated_results = []
19
19
 
20
+ # Useful if doing pagination where you would need the last key evaluated
21
+ return_last_evaluated_key = options.delete(:return_last_evaluated_key)
20
22
  batch_size = options.delete(:batch) || DEFAULT_BATCH_SIZE
21
23
  max_results_limit = options[:limit]
22
24
  if options[:limit] && options[:limit] > batch_size
@@ -53,7 +55,14 @@ module Toy
53
55
  end
54
56
  end
55
57
 
56
- aggregated_results
58
+ if return_last_evaluated_key
59
+ {
60
+ last_evaluated_key: response.last_evaluated_key,
61
+ members: aggregated_results
62
+ }
63
+ else
64
+ aggregated_results
65
+ end
57
66
  end
58
67
 
59
68
  def count_range(hash_value, options={})
@@ -1,5 +1,5 @@
1
1
  module Toy
2
2
  module Dynamo
3
- VERSION = "0.1.11"
3
+ VERSION = "0.1.12"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: toy-dynamo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.11
4
+ version: 0.1.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cary Dunn
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-03-10 00:00:00.000000000 Z
11
+ date: 2014-03-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler