Skip to content

Commit 8f42a3d

Browse files
committed
chore: README tidying
1 parent 3cead5f commit 8f42a3d

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

README.md

+6-4
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ For example, iterating over an array may yield index values 1, 2 and 3.
192192
Deleting the value at index 1 would change the index for the remaining values.
193193
Next iteration might yield index 2, but since 1 was deleted it is now really at index 1.
194194

195-
To avoid having to deal with such problems, use the built in `#delete` method below.
195+
To avoid having to deal with such problems, use the `#delete` method instead.
196196

197197

198198
Lastly, the `#each` iterator's fourth yield parameter is the [normalized path](https://www.rfc-editor.org/rfc/rfc9535.html#name-normalized-paths) to the matched value.
@@ -205,8 +205,10 @@ This is a jsonpath query string that uniquely points to the matched value.
205205
paths << path
206206
end
207207
paths
208-
# [ # "$['birds']", "$['dogs']", "$['birds'][0]", "$['birds'][1]", "$['birds'][2]",
209-
# "$['dogs'][0]", "$['dogs'][1]", "$['dogs'][2]"]
208+
# [
209+
# "$['birds']", "$['dogs']", "$['birds'][0]", "$['birds'][1]",
210+
# "$['birds'][2]", "$['dogs'][0]", "$['dogs'][1]", "$['dogs'][2]"
211+
# ]
210212
```
211213

212214
##### #delete
@@ -224,7 +226,7 @@ The `#delete` method deletes matched values from the input.
224226

225227
##### #delete_if
226228

227-
The `#delete_if` method yields matched values to a block, and deletes them if the block returns a truthy value.
229+
The `#delete_if` method yields matched values to a block, and deletes them if the block returns a truthy result.
228230
This allows values to be deleted based on conditions that can't be tested by a JSONPath query:
229231
```ruby
230232
# delete any book from the store json data that is not in the database

lib/janeway/enumerator.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def delete_if(&block)
5454
end
5555

5656
# Assign the given value at every query match.
57-
# @param value [Object]
57+
# @param replacement [Object]
5858
# @return [void]
5959
def replace(replacement = :no_replacement_value_was_given, &block)
6060
if replacement != :no_replacement_value_was_given && block_given?

0 commit comments

Comments
 (0)