From: Robert Klemme Date: 2008-08-13T01:38:01+09:00 Subject: Re: How do I unsplat something? On 12.08.2008 18:21, Patrick Li wrote: > Is there any easy to unsplat an item? > ie. 1 becomes [1] > [2,3] remains [2,3] ? > > so far i found: > a = *[1] > *b = *a #=> [1] > a = *[1,2] > *b = *a #=> [1,2] > > but this doesn't work if a is a hash, because hash overrides the to_a > method > a = *[{"a"=>1}] > *b = *a #=> [["a",1]] when i actually want: [{"a"=>1}] What result are you trying to get? robert