You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.adoc
+10-3Lines changed: 10 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2297,7 +2297,7 @@ Prefer the use of exceptions from the standard library over introducing new exce
2297
2297
=== Parallel Assignment [[parallel-assignment]]
2298
2298
2299
2299
Avoid the use of parallel assignment for defining variables.
2300
-
Parallel assignment is allowed when it is the return of a method call, used with the splat operator, or when used to swap variable assignment.
2300
+
Parallel assignment is allowed when it is the return of a method call (e.g. `Hash#values_at`), used with the splat operator, or when used to swap variable assignment.
2301
2301
Parallel assignment is less readable than separate assignment.
2302
2302
2303
2303
[source,ruby]
@@ -4404,18 +4404,25 @@ batman.fetch(:powers, obtain_batman_powers) # obtain_batman_powers is an expensi
4404
4404
batman.fetch(:powers) { obtain_batman_powers }
4405
4405
----
4406
4406
4407
-
=== `Hash#values_at` [[hash-values-at]]
4407
+
=== `Hash#values_at` and `Hash#fetch_values` [[hash-values-at-and-hash-fetch-values]]
4408
4408
4409
-
Use `Hash#values_at` when you need to retrieve several values consecutively from a hash.
4409
+
Use `Hash#values_at` or `Hash#fetch_values` when you need to retrieve several values consecutively from a hash.
0 commit comments