aws-record 2.9.0 → 2.10.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (39) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +330 -0
  3. data/LICENSE +202 -0
  4. data/VERSION +1 -0
  5. data/lib/aws-record/record/attribute.rb +5 -15
  6. data/lib/aws-record/record/attributes.rb +32 -29
  7. data/lib/aws-record/record/batch.rb +99 -35
  8. data/lib/aws-record/record/batch_read.rb +186 -0
  9. data/lib/aws-record/record/batch_write.rb +9 -14
  10. data/lib/aws-record/record/buildable_search.rb +4 -2
  11. data/lib/aws-record/record/client_configuration.rb +1 -12
  12. data/lib/aws-record/record/dirty_tracking.rb +1 -12
  13. data/lib/aws-record/record/errors.rb +1 -12
  14. data/lib/aws-record/record/item_collection.rb +2 -13
  15. data/lib/aws-record/record/item_data.rb +1 -12
  16. data/lib/aws-record/record/item_operations.rb +47 -12
  17. data/lib/aws-record/record/key_attributes.rb +1 -12
  18. data/lib/aws-record/record/marshalers/boolean_marshaler.rb +1 -12
  19. data/lib/aws-record/record/marshalers/date_marshaler.rb +1 -12
  20. data/lib/aws-record/record/marshalers/date_time_marshaler.rb +1 -12
  21. data/lib/aws-record/record/marshalers/epoch_time_marshaler.rb +1 -12
  22. data/lib/aws-record/record/marshalers/float_marshaler.rb +1 -12
  23. data/lib/aws-record/record/marshalers/integer_marshaler.rb +1 -12
  24. data/lib/aws-record/record/marshalers/list_marshaler.rb +1 -12
  25. data/lib/aws-record/record/marshalers/map_marshaler.rb +1 -12
  26. data/lib/aws-record/record/marshalers/numeric_set_marshaler.rb +1 -12
  27. data/lib/aws-record/record/marshalers/string_marshaler.rb +1 -12
  28. data/lib/aws-record/record/marshalers/string_set_marshaler.rb +1 -12
  29. data/lib/aws-record/record/marshalers/time_marshaler.rb +1 -12
  30. data/lib/aws-record/record/model_attributes.rb +1 -12
  31. data/lib/aws-record/record/query.rb +1 -12
  32. data/lib/aws-record/record/secondary_indexes.rb +1 -12
  33. data/lib/aws-record/record/table_config.rb +1 -12
  34. data/lib/aws-record/record/table_migration.rb +1 -12
  35. data/lib/aws-record/record/transactions.rb +39 -7
  36. data/lib/aws-record/record/version.rb +2 -13
  37. data/lib/aws-record/record.rb +1 -12
  38. data/lib/aws-record.rb +2 -12
  39. metadata +7 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6316b0ad6349fdea29d10e1325b6044b54eb3f2696a9bd1692cc30881e5e2e02
4
- data.tar.gz: 57c1d3c37435e3bc79eac488738c08f8ac6536bfbd5f493ac221f248bdf3e8c8
3
+ metadata.gz: 4b6ed904b6114e07186e11b86c8e8a3e7d94c487cdfc7aba412f2f85a0352528
4
+ data.tar.gz: 5a3cbab3c5daf7b820b0d865ab433de7e8a17d9030916dc513e8db8d8c027d0d
5
5
  SHA512:
6
- metadata.gz: 8bdca623e0884f5cd2a704bf807be58687077e04f746e5c99a6e15ce2df4ad378afd6e3d6bdb74899d4a86521e921fd588a5fbdc5ba1c6b6c06e3daf08ad3d16
7
- data.tar.gz: 2448123077cea61bf1ab263278ce1a2209d69d9a7ed53d8f665feb8bef2c7185c447378f3c4ae70a96a16ef4d62e4d2a3ffd1769f94bc367e8cd2e0c1733c4cd
6
+ metadata.gz: 9acd345bf2e2280b51e0ed0be2b96a8788f02e358fb9e49ebc91e18f5d6dd1016756e7ce27b36174e15f73084b8e1f5f591d8424d832fd8a27ee5c3794cf1a1c
7
+ data.tar.gz: 21995e47b1565913b5ae1812c19074818a5a1ca9ed7b468d6f0f41273458f92d398dc8fdcec64ca4eebef45f49492c1f134939b7ab97274493f0fde157af860e
data/CHANGELOG.md ADDED
@@ -0,0 +1,330 @@
1
+ 2.10.1 (2023-01-17)
2
+ ------------------
3
+
4
+ * Issue - Set `Aws::Record::VERSION` constant from the `VERSION` file
5
+
6
+ 2.10.0 (2023-01-13)
7
+ ------------------
8
+
9
+ * Feature - Implement the `BatchGetItem` operation (#122)
10
+
11
+ 2.9.0 (2022-11-16)
12
+ ------------------
13
+
14
+ * Feature - Add support for inheritance. Aws Record models can now be extended using standard ruby inheritance (#80).
15
+
16
+ 2.8.0 (2022-10-12)
17
+ ------------------
18
+
19
+ * Feature - Add support for atomic counter (#144)
20
+
21
+ 2.7.0 (2021-10-28)
22
+ ------------------
23
+
24
+ * Feature - Implement the `BatchWriteItem` operation (#119)
25
+
26
+ 2.6.1 (2021-08-10)
27
+ ------------------
28
+
29
+ * Issue - Fix FrozenError on BuildableSearch (#115)
30
+
31
+ 2.6.0 (2021-05-13)
32
+ ------------------
33
+
34
+ * Feature - Add support for on-demand-billing for table migrations (#94)
35
+
36
+ 2.5.0 (2020-10-13)
37
+ ------------------
38
+
39
+ * Feature - `Aws::Record::BuildableSearch` - Support queries yielding heterogeneous results using `multi_model_filter` (#107)
40
+
41
+ 2.4.1 (2020-05-29)
42
+ ------------------
43
+
44
+ * Issue - Allow symbols for database_attribute_name
45
+ * Issue - Correctly allow lambda/proc for default_value
46
+
47
+ 2.4.0 (2019-07-16)
48
+ ------------------
49
+
50
+ * Feature - Aws::Record::BuildableSearch - Adds support for query and scan builders using substitution expressions. This allows for streamlined and expressive queries and scans using aws-record.
51
+
52
+ 2.3.0 (2019-02-08)
53
+ ------------------
54
+
55
+ * Feature - Aws::Record::Transactions - Adds support for transactional find and transactional get requests. You can learn more about these new APIs in the [documentation](https://docs.aws.amazon.com/awssdkrubyrecord/api/Aws/Record/Transactions.html).
56
+
57
+ 2.2.0 (2018-12-05)
58
+ ------------------
59
+
60
+ * Feature - Aws::Record::TableConfig - Adds support for the "PAY_PER_REQUEST" billing mode in table configurations.
61
+
62
+ 2.1.2 (2018-11-15)
63
+ ------------------
64
+
65
+ * Issue - Aws::Record::Marshalers::EpochTimeMarshaler - Fixed a bug where epoch time objects didn't properly marshal from database entries.
66
+
67
+ 2.1.1 (2018-07-10)
68
+ ------------------
69
+
70
+ * Feature - Aws::Record::TableConfig - Adds `:ttl_attribute` to the TableConfig DSL. When used with `epoch_time_attr` attributes or other attributes stored as epoch time, your TableConfig migrations will enable TTL on your DynamoDB table, and will use your specified attribute as the TTL attribute.
71
+
72
+ * Feature - Aws::Record::Marshalers::EpochTimeMarshaler - Adds the `epoch_time_attr`, which behaves much like `time_attr` except the Amazon DynamoDB storage type is numeric, and the serialized value is epoch seconds.
73
+
74
+ 2.1.0 (2018-06-25)
75
+ ------------------
76
+
77
+ * Feature - Aws::Record - Add the `persisted?`, `new_record?`, and `destroyed?` methods to `Aws::Record`, which supports use cases where you'd like to see if a record has just been newly initialized, or has been deleted or was a preexisting record retrieved from DynamoDB. Note that these methods are present in `ActiveModel::Model` so you should require that module before `Aws::Record`
78
+
79
+ * Feature - Aws::Record - Add the `assign_attributes`, `update`, and `update!` methods to `Aws::Record` which supports the use case where the user might want to mass assign or update a records attributes by hash. `update!` also ensures that a `ValidationError` is thrown on an invalid update
80
+
81
+ * Upgrading - If you already include `ActiveModel::Model` on your models the new `persisted?`, `new_record?` and `destroyed?` methods will not function properly unless you include `ActiveModel::Model` before `Aws::Record`. Additionally, new methods could lead to collisions if you happened to have attributes such as `:update` or `:assign_attributes`. In such a case, you would want to version lock below `2.1.0`, or use the `:database_attribute_name` property and change your attribute name in code.
82
+
83
+ 2.0.2 (2018-06-08)
84
+ ------------------
85
+
86
+ * Feature - Aws::Record::Marshalers::TimeMarshaler - Adds the `time_attr` method to AWS Record models, which uses `Time` as the underlying type.
87
+
88
+ 2.0.1 (2017-10-27)
89
+ ------------------
90
+
91
+ * Feature - Aws::Record::ItemCollection - Add the `#page` and `#last_evaluated_key` methods to `Aws::Record::ItemCollection`. This helps to support use cases where you'd like to control the result set size with the `:limit` parameter, or if you want to expose pagination capabilities to an outside caller, for example a list-type operation exposed in a web API.
92
+
93
+ 2.0.0 (2017-08-29)
94
+ ------------------
95
+
96
+ * Upgrading - Aws::Record - Support version 3 of the AWS SDK for Ruby. This is being released as major version 2 of `aws-record`, though the APIs remain the same. Do note, however, that we've changed our SDK dependency to only depend on `aws-sdk-dynamodb`. This means that if you were depending on other service clients transitively via `aws-record`, you will need to add dependencies on the appropriate service gems when upgrading.
97
+
98
+ 1.1.1 (2017-06-16)
99
+ ------------------
100
+
101
+ * Feature - Support lambdas for default attribute values.
102
+
103
+ ```ruby
104
+ date_attr :date, default_value -> { Date.today }
105
+ ```
106
+
107
+ * Issue - An attribute's default_value could be modified and carried over to
108
+ new instances of the model. With this change, default values are deep copied,
109
+ and are hydrated at item creation to ensure correct persistence of mutable
110
+ objects.
111
+
112
+ See [related GitHub issue #69](https://github.com/aws/aws-sdk-ruby-record/issues/69)
113
+
114
+ 1.1.0 (2017-04-21)
115
+ ------------------
116
+
117
+ * Feature - Aws::Record::TableConfig - A declarative way to describe
118
+ configuration for your Amazon DynamoDB tables, with smart migrations based on
119
+ the current remote state. More details in the documentation.
120
+
121
+ * Issue - Aws::Record::TableMigration - Legacy table migrations could have
122
+ issues with global secondary indexes if a table was deleted and recreated
123
+ multiple times.
124
+
125
+ See [related GitHub issue #64](https://github.com/aws/aws-sdk-ruby-record/issues/64).
126
+
127
+ 1.0.3 (2016-12-19)
128
+ ------------------
129
+
130
+ * Feature - Aws::Record::ItemOperations - Adds the `find_with_opts` class method
131
+ to model instances, which allows users to pass in both the key (as in `find`)
132
+ and parameters which are to be passed through to the underlying
133
+ `Aws::DynamoDB::Client#get_item` call.
134
+
135
+ 1.0.2 (2016-12-02)
136
+ ------------------
137
+
138
+ * Issue - Aws::Record::ItemOperations - Fixes an issue where update operations
139
+ which consist of only `REMOVE` expressions failed due to an empty
140
+ `:expression_attribute_values` map. The fix makes the presence of that map
141
+ conditional on the existance of valid values.
142
+
143
+ 1.0.1 (2016-08-24)
144
+ ------------------
145
+
146
+ * Issue - Aws::Record::ItemCollection - Fixes a faulty `#empty?` implementation,
147
+ which could return `false` for a response which is, in fact, empty.
148
+
149
+ 1.0.0 (2016-08-15)
150
+ ------------------
151
+
152
+ * Issue - Aws::Record - Fixes the `#table_exists?` and `#provisioned_throughput`
153
+ methods, which could fail if called before `#table_name`.
154
+
155
+ 1.0.0.pre.10 (2016-08-03)
156
+ ------------------
157
+
158
+ * Feature - Aws::Record - Refactored tracking of model attributes, key attributes,
159
+ and item data to use internal classes over module composition. Dirty tracking is
160
+ also handled more consistently across attributes, and turning on/off of dirty
161
+ tracking is only possible at the model level (not for individual attributes).
162
+
163
+ 1.0.0.pre.9 (2016-07-22)
164
+ ------------------
165
+
166
+ * Feature - Aws::Record::Attribute - Added support for default values at the attribute
167
+ level.
168
+
169
+ * Feature - Aws::Record::Marshalers - Removed the marshalers in the `Aws::Attributes`
170
+ namespace, replacing them with instantiated marshaler objects. This enables
171
+ more functionality in marshalers such as the Date/DateTime marshalers.
172
+
173
+ * Feature - Aws::Record::DirtyTracking - Improves dirty tracking by adding
174
+ support for tracking mutations of attribute value objects. This feature is on
175
+ by default for the "collection" types: `:list_attr`, `:map_attr`,
176
+ `:string_set_attr`, and `:numeric_set_attr`.
177
+
178
+ Before this feature, the `#save` method's default behavior of running an
179
+ update call for dirty attributes only could cause problems for users of
180
+ collection attributes. As many of them are commonly manipulated using mutable
181
+ state, the underlying "clean" version of the objects would be modified and the
182
+ updated object would not be recognized as dirty, and therefore would not be
183
+ updated at all unless explicitly marked as dirty or through a force put.
184
+
185
+ ```ruby
186
+ class Model
187
+ include Aws::Record
188
+ string_attr :uuid, hash_key: true
189
+ list_attr :collection
190
+ end
191
+
192
+ item = Model.new(uuid: SecureRandom.uuid, collection: [1,2,3])
193
+ item.clean! # As if loaded from the database, to demonstrate the new tracking.
194
+ item.dirty? # => false
195
+ item.collection << 4 # In place mutation of the "collection" array.
196
+ item.dirty? # => true (Previous versions would not recognize this as dirty.
197
+ item.save # Would call Aws::DynamoDB::Client#update_item for :collection only.
198
+ ```
199
+
200
+ Note that this feature is implemented using deep copies of collection objects
201
+ in memory, so there is a potential memory/performance hit in exchange for the
202
+ added accuracy. As such, mutation tracking can be explicitly turned off at the
203
+ attribute level or at the full model level, if desired.
204
+
205
+ ```ruby
206
+ # Note that the disabling of mutation tracking is redundant in this example,
207
+ # for illustration purposes.
208
+ class Model
209
+ include Aws::Record
210
+ disable_mutation_tracking # For turning off mutation at the model level.
211
+ string_attr :uuid, hash_key: true
212
+ list_attr :collection, mutation_tracking: false # Turn off at attr level.
213
+ end
214
+ ```
215
+
216
+ 1.0.0.pre.8 (2016-05-19)
217
+ ------------------
218
+
219
+ * Feature - Aws::Record - Adds the ability to set initial attribute values when
220
+ calling `#initialize`. Additionally, can call `update` on a model to directly
221
+ call `Aws::DynamoDB::Client#update_item`.
222
+
223
+ 1.0.0.pre.7 (2016-04-21)
224
+ ------------------
225
+
226
+ * Upgrading - Aws::Record - This release includes changes to validation and
227
+ to the `#save` and `#save!` methods. With this release, the validation hooks
228
+ in `Aws::Record::Attribute` have been removed. Additionally, `#save` will
229
+ resume raising exceptions on client errors. However, `#save` and `#save!`
230
+ will attempt to call `#valid?` if defined on the model, and will return false
231
+ or raise as appropriate if that method is defined and returns false.
232
+
233
+ As a part of this change, we've removed the built in `#valid?` and `#errors`
234
+ methods. If you were a user of those, consider bringing your own validation
235
+ library such as `ActiveModel::Validations`.
236
+
237
+ * Issue - Aws::Record - Removes `#valid?` and `#errors` methods, which caused a
238
+ conflict with the ability to bring your own validation library such as
239
+ `ActiveModel::Validations`. Added tests as an example and to test
240
+ compatibility.
241
+
242
+ 1.0.0.pre.6 (2016-04-19)
243
+ ------------------
244
+
245
+ * Feature - Aws::Record::Attributes - Improves default marshaling behavior for
246
+ set types. Now, if your object responds to `:to_set`, such as an Array, it
247
+ will automatically be marshaled to a set type when persisted.
248
+
249
+ 1.0.0.pre.5 (2016-04-19)
250
+ ------------------
251
+
252
+ * Upgrading - Aws::Record - The conditional put/update logic added to `#save`
253
+ and `#save!` is not backwards compatible in some cases. For example, the
254
+ following code would work in previous versions, but not in this version:
255
+
256
+ ```ruby
257
+ item = Model.new # Assume :id is the hash key, there is no range key.
258
+ item.id = 1
259
+ item.content = "First write."
260
+ item.save
261
+
262
+ smash = Model.new
263
+ smash.id = 1
264
+ smash.content = "Second write."
265
+ smash.save # false, and populates the errors array.
266
+ smash.save(force: true) # This will skip the conditional check and work.
267
+
268
+ updatable = Model.find(id: 1)
269
+ updatable.content = "Update write."
270
+ updatable.save # This works and uses an update client call.
271
+ ```
272
+
273
+ If you want to maintain previous behavior of unconditional puts, add the
274
+ `force: true` option to your `#save` calls. However, this risks overwriting
275
+ unmodeled attributes, or attributes excluded from your projection. But, the
276
+ option is available for you to use.
277
+
278
+ * Upgrading - Aws::Record - The split of the `#save` method into `#save` and
279
+ `#save!` breaks when your code is expecting `#save` to raise exceptions.
280
+ `#save` will return false on a failed write and populate an `errors` array.
281
+ If you wish to raise exceptions on failed save attempts, use the `#save!`
282
+ method.
283
+
284
+ * Feature - Aws::Record - Adds logic to determine if `#save` and `#save!` calls
285
+ should use `Aws::DynamoDB::Client#put_item` or
286
+ `Aws::DynamoDB::Client#update_item`, depending on which item attributes are
287
+ marked as dirty. `#put_item` calls are also made conditional on the key not
288
+ existing, so accidental overwrites can be prevented. Old behavior of
289
+ unconditional `#put_item` calls can be done using the `force: true` parameter.
290
+
291
+ * Feature - Aws::Record - Separates the `#save` method into `#save` and
292
+ `#save!`. `#save!` will raise any errors that occur during persistence, while
293
+ `#save` will populate an errors array and cause `#valid?` calls on the item to
294
+ return `false`.
295
+
296
+ * Issue - Aws::Record - Changed how default table names are generated. In the
297
+ past, the default table name could not handle class names that included
298
+ modules. Now, module namespaces are appended to the default table name. This
299
+ should not affect any existing model classes, as previously any affected
300
+ models would have failed to create a table in DynamoDB.
301
+
302
+ 1.0.0.pre.4 (2016-02-11)
303
+ ------------------
304
+
305
+ * Feature - Aws::Record::DirtyTracking - `Aws::Record` items will now keep track
306
+ of "dirty" changes from database state. The DirtyTracking module provides a
307
+ set of helper methods to handle dirty attributes.
308
+
309
+ 1.0.0.pre.3 (2016-02-10)
310
+ ------------------
311
+
312
+ * Feature - Aws::Record - Support for additional marshaled types, such as lists,
313
+ maps, and string/numeric sets.
314
+
315
+ 1.0.0.pre.2 (2016-02-04)
316
+ ------------------
317
+
318
+ * Feature - Aws::Record - Provides a low-level interface for the client `#query`
319
+ and `#scan` methods. Query and Scan results are surfaces as an enumerable
320
+ collection of `Aws::Record` items.
321
+
322
+ * Feature - Aws::Record - Support for adding global secondary indexes and local
323
+ secondary indexes to your model classes. Built-in support for creating these
324
+ indexes at table creation time.
325
+
326
+ 1.0.0.pre.1 (2015-12-23)
327
+ ------------------
328
+
329
+ * Feature - Aws::Record - Initial development release of the `aws-record` gem.
330
+ Includes basic table and item functionality for CRUD operations.
data/LICENSE ADDED
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 2.10.1
@@ -1,15 +1,4 @@
1
- # Copyright 2015-2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
- #
3
- # Licensed under the Apache License, Version 2.0 (the "License"). You may not
4
- # use this file except in compliance with the License. A copy of the License is
5
- # located at
6
- #
7
- # http://aws.amazon.com/apache2.0/
8
- #
9
- # or in the "license" file accompanying this file. This file is distributed on
10
- # an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
11
- # or implied. See the License for the specific language governing permissions
12
- # and limitations under the License.
1
+ # frozen_string_literal: true
13
2
 
14
3
  module Aws
15
4
  module Record
@@ -45,7 +34,8 @@ module Aws
45
34
  # nil values will be ignored and not persisted. By default, is false.
46
35
  # @option options [Object] :default_value Optional attribute used to
47
36
  # define a "default value" to be used if the attribute's value on an
48
- # item is nil or not set at persistence time.
37
+ # item is nil or not set at persistence time. Additionally, lambda can
38
+ # be used as a default value.
49
39
  def initialize(name, options = {})
50
40
  @name = name
51
41
  @database_name = (options[:database_attribute_name] || name).to_s
@@ -79,8 +69,8 @@ module Aws
79
69
  @marshaler.serialize(cast_value)
80
70
  end
81
71
 
82
- # @return [Boolean] true if this attribute will actively persist nil
83
- # values, false otherwise. Default: false
72
+ # @return [Boolean] +true+ if this attribute will actively persist nil
73
+ # values, +false+ otherwise. Default: +false+
84
74
  def persist_nil?
85
75
  @persist_nil ? true : false
86
76
  end