Skip to content

Commit 180f675

Browse files
committed
Polish and reword comments
1 parent 6851ed1 commit 180f675

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
lines changed

lib/dynamoid/persistence.rb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,8 @@ def update!(hash_key, range_key_value = nil, attrs)
325325
# @param range_key_value [Scalar value] range key (optional)
326326
# @param attrs [Hash]
327327
# @param conditions [Hash] (optional)
328+
# @option conditions [Hash] :if conditions on attribute values
329+
# @option conditions [Hash] :unless_exists conditions on attributes presence
328330
# @return [Dynamoid::Document|nil] Updated document
329331
def update_fields(hash_key_value, range_key_value = nil, attrs = {}, conditions = {})
330332
optional_params = [range_key_value, attrs, conditions].compact
@@ -387,6 +389,8 @@ def update_fields(hash_key_value, range_key_value = nil, attrs = {}, conditions
387389
# @param range_key_value [Scalar value] range key (optional)
388390
# @param attrs [Hash]
389391
# @param conditions [Hash] (optional)
392+
# @option conditions [Hash] :if conditions on attribute values
393+
# @option conditions [Hash] :unless_exists conditions on attributes presence
390394
# @return [Dynamoid::Document|nil] Updated document
391395
def upsert(hash_key_value, range_key_value = nil, attrs = {}, conditions = {})
392396
optional_params = [range_key_value, attrs, conditions].compact
@@ -533,7 +537,8 @@ def persisted?
533537
# If a model is new and hash key (+id+ by default) is not assigned yet
534538
# it was assigned implicitly with random UUID value.
535539
#
536-
# If +lock_version+ attribute is declared it will be incremented. If it's blank then it will be initialized with 1.
540+
# If +lock_version+ attribute is declared it will be incremented. If it's
541+
# blank then it will be initialized with 1.
537542
#
538543
# +save+ method call raises +Dynamoid::Errors::RecordNotUnique+ exception
539544
# if primary key (hash key + optional range key) already exists in a

lib/dynamoid/persistence/save.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ def self.call(model, **options)
1212

1313
def initialize(model, touch: nil)
1414
@model = model
15-
@touch = touch # touch=false means explicit disabling of updating the `updated_at` attribute
15+
@touch = touch # `touch: false` means explicit disabling of updating the `updated_at` attribute
1616
end
1717

1818
def call

lib/dynamoid/transaction_read.rb

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,9 @@ def commit
9696
#
9797
# Please note that there are the following differences between
9898
# transactional and non-transactional +find+:
99-
# - transactional +find+ preserves order of models in result when multiple ids are given
100-
# - transactional +find+ doesn't return results immediately, a single collection with results of all the +find+ calls is returned instead
99+
# - transactional +find+ preserves order of models in result when given multiple ids
100+
# - transactional +find+ doesn't return results immediately, a single
101+
# collection with results of all the +find+ calls is returned instead
101102
# - +:consistent_read+ option isn't supported
102103
# - transactional +find+ is subject to limitations of the
103104
# [TransactGetItems](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_TransactGetItems.html)
@@ -106,7 +107,7 @@ def commit
106107
# @param [Object|Array] ids a single primary key or an array of primary keys
107108
# @param [Hash] options optional parameters of the operation
108109
# @option options [Object] :range_key sort key of a model; required when a single partition key is given and a sort key is declared for a model
109-
# @option options [true|false] :raise_key whether to raise a RecordNotFound exception; specify explicitly +raise: false+ to suppress the exception; default is true
110+
# @option options [true|false] :raise_error whether to raise a +RecordNotFound+ exception; specify explicitly +raise_error: false+ to suppress the exception; default is +true+
110111
# @return [nil]
111112
#
112113
# @example Find by partition key

0 commit comments

Comments
 (0)