As everyone mentions, it's a splat. Looking for Ruby syntax is impossible, and I've asked this in other questions. The answer to that part of the question is that you search on
asterisk in ruby syntax
in Google. Google is there for you, just put what you see into words.
Anyhoo, like a lot of Ruby code, that code is quite dense. The
line.split(/=|;/)
makes an array of SIX elements, first_name, mickey, last_name, mouse, country, usa
. Then the splat is used to make that into a Hash. Now the Ruby people always send you to look at the Splat method, since everything is exposed in Ruby. I have no idea where it is, but once you have that, you'll see that it runs a for
through the array and builds the hash.
You would look for the code here. If you cannot find it (I could not), you would try to write some lame code yourself like this (which works, but is NOT ruby-like code):
line = "first_name=mickey;last_name=mouse;country=usa"
presplat = line.split(/=|;/)
splat = Hash.new
for i in (0..presplat.length-1)
splat[presplat[i]] = presplat[i+1] if i%2==0
end
puts splat["first_name"]
and then the Ruby gang will be able to tell you why your code is silly, bad, or just plain wrong.
Edit: If you've read this far, take a read through this, which doesn't explain splat but you do need to know it.