What does *:: (asterisk double colon) do in Ruby? What does *:: (asterisk double colon) do in Ruby? ruby ruby

What does *:: (asterisk double colon) do in Ruby?


I was reading the code wrong; it's not a "*::" operator at all.

Here's what's happening:

  • Find the Date class in the global scope (::Date)
  • call _parse() to get a hash of values
  • call values_at to turn the hash into an array
  • use the asterisk operator in its typical function of turning an array into multiple arguments for a method call
  • call new_date(), passing the array elements in for its year, mon, and mday arguments.

The lack of space between the * and :: operators made it confusing. :-\