aws-sdk 1.3.1 → 1.3.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/aws/core.rb +1 -1
- data/lib/aws/dynamo_db.rb +28 -27
- data/lib/aws/record/hash_model.rb +1 -1
- metadata +3 -3
data/lib/aws/core.rb
CHANGED
data/lib/aws/dynamo_db.rb
CHANGED
@@ -41,7 +41,7 @@ module AWS
|
|
41
41
|
#
|
42
42
|
# table = dynamo_db.tables.create(
|
43
43
|
# "MyTable",
|
44
|
-
# :hash_key =>
|
44
|
+
# :hash_key => { :id => :string }
|
45
45
|
# )
|
46
46
|
# sleep 1 while t.status == :creating
|
47
47
|
#
|
@@ -70,39 +70,40 @@ module AWS
|
|
70
70
|
#
|
71
71
|
# = Examples
|
72
72
|
#
|
73
|
-
#
|
74
|
-
#
|
75
|
-
#
|
76
|
-
#
|
77
|
-
# sleep 1 while table.status == :creating
|
78
|
-
# table.status #=> :active
|
73
|
+
# # create a table (10 read and 5 write capacity units) with the
|
74
|
+
# # default schema (id string hash key)
|
75
|
+
# dynamo_db = AWS::DynamoDB.new
|
76
|
+
# table = dynamo_db.tables.create('my-table', 10, 5)
|
79
77
|
#
|
80
|
-
#
|
81
|
-
#
|
82
|
-
#
|
78
|
+
# sleep 1 while table.status == :creating
|
79
|
+
# table.status #=> :active
|
80
|
+
#
|
81
|
+
# # get an existing table by name and specify its hash key
|
82
|
+
# table = dynamo_db.tables['another-table']
|
83
|
+
# table.hash_key = [:id, :number]
|
83
84
|
#
|
84
|
-
#
|
85
|
-
#
|
85
|
+
# # add an item
|
86
|
+
# item = table.items.create('id' => 12345, 'foo' => 'bar')
|
86
87
|
#
|
87
|
-
#
|
88
|
-
#
|
88
|
+
# # add attributes to an item
|
89
|
+
# item.attributes.add 'category' => %w(demo), 'tags' => %w(sample item)
|
89
90
|
#
|
90
|
-
#
|
91
|
-
#
|
92
|
-
#
|
93
|
-
#
|
94
|
-
#
|
95
|
-
#
|
91
|
+
# # update an item with mixed add, delete, update
|
92
|
+
# item.attributes.update do |u|
|
93
|
+
# u.add 'colors' => %w(red)
|
94
|
+
# u.set 'category' => 'demo-category'
|
95
|
+
# u.delete 'foo'
|
96
|
+
# end
|
96
97
|
#
|
97
|
-
#
|
98
|
-
#
|
98
|
+
# # delete attributes
|
99
|
+
# item.attributes.delete 'colors', 'category'
|
99
100
|
#
|
100
|
-
#
|
101
|
-
#
|
102
|
-
#
|
101
|
+
# # get attributes
|
102
|
+
# item.attributes.to_h
|
103
|
+
# #=> {"id"=>#<BigDecimal:10155f5d0,'0.12345E5',9(18)>, "tags"=>#<Set: {"item", "sample"}>}
|
103
104
|
#
|
104
|
-
#
|
105
|
-
#
|
105
|
+
# # delete an item and all of its attributes
|
106
|
+
# item.delete
|
106
107
|
#
|
107
108
|
class DynamoDB
|
108
109
|
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: aws-sdk
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 31
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 3
|
9
|
-
-
|
10
|
-
version: 1.3.
|
9
|
+
- 2
|
10
|
+
version: 1.3.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Amazon Web Services
|