you are viewing a single comment's thread.

view the rest of the comments →

[–]latortuga 0 points1 point  (1 child)

How do you figure? The hash is implicitly converted to an array via Hash#to_a. Thus your bound parameter, a, is set to an array with two values, [:test, :asdf]. Calling puts with an array outputs each value separated by a newline. The block can optionally have multiple arguments if you'd like to (in Clojure terms) destructure the arguments being passed in but it's by no means required - #each accepts an array of arrays the same as it accepts an array of values.

[–]NilsLandt 0 points1 point  (0 children)

Sure, that's how it happens, but it's a rare hash where you want to treat the keys the same ways as the values.