From 619af4fd6404168a368442941ec80e739aef2609 Mon Sep 17 00:00:00 2001 From: Kouhei Yanagita Date: Wed, 15 Feb 2023 12:43:55 +0900 Subject: [DOC] Add an example of the splat operator with a non-array object (#7098) --- doc/syntax/assignment.rdoc | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'doc') diff --git a/doc/syntax/assignment.rdoc b/doc/syntax/assignment.rdoc index 037c2032a8..e30cb35adf 100644 --- a/doc/syntax/assignment.rdoc +++ b/doc/syntax/assignment.rdoc @@ -403,6 +403,10 @@ assigning. This is similar to multiple assignment: p a # prints [1, 2, 3] + b = *1 + + p b # prints [1] + You can splat anywhere in the right-hand side of the assignment: a = 1, *[2, 3] -- cgit v1.2.1