foo = [[1, 2], [3, 4]]
foo.each do |bar,|
p(bar)
end
Rubyfmt's output
foo = [[1, 2], [3, 4]]
foo.each do |bar|
p(bar)
end
This breaks because
With the block argument list |bar,|, the value of bar inside the block will be 1 and 3.
With the block argument list |bar|, the value of bar inside the block will be [1, 2] and [3, 4].
ruby 3.2.2 (2023-03-30 revision e51014f9c0) [arm64-darwin22]
Input file
Rubyfmt's output
This breaks because
With the block argument list
|bar,|
, the value ofbar
inside the block will be1
and3
. With the block argument list|bar|
, the value ofbar
inside the block will be[1, 2]
and[3, 4
].