I\'m learning the basics of Ruby (just starting out), and I came across the Hash.[] method. It was introduced with
a = [\"foo\", 1, \"bar\", 2]
=> [\"foo\", 1
Hash["a", "b", "c", "d"] is equivalent to Hash.[]("a", "b", "c", "d"). Almost everything in Ruby is a method call. 5 + 5 is equivalent to 5.+(5).
Given a = ["a", "b", "c", "d"] Hash[*a] is equivalent to Hash["a", "b", "c", "d"], which in turn is equivalent to Hash.[]("a", "b", "c", "d"). Similarly, foo(*a) is equivalent to foo("a", "b", "c", "d") This is called the explode operator, and allows sending an array to a method and have each item in the array count as one argument to the method, instead of sending the array to the method as the first argument.
To specifically answer your update, there's nothing special that lets you put *a inside the brackets. The brackets is just sugar for a normal method call. The only "special" thing here is that you can send *a to any method.