Why does Hash#values_at not working?

While the below code working :-

m = {:a => 2, :b => 3,:c => 44,:g => 14}
a = [:a,:b,:g]
p m.values_at(*[:a,:b,:g]) #=> [2, 3, 14]

why the below not working?

h = {
  'arg0' => '126150656000',
  'arg1' => 'Intel(R) Core(TM) i7-2640M CPU @ 2.80GHz',
  'arg2' => '2790',
  'arg3' => '3276320768',
  'arg4' => '8467496960',
  'arg5' => 'Windows 7',
  'arg7' => 'amd64',
  'arg6' => '6.1',
  'arg8' => '2',
  'arg9' => '1920',
  'arg10' => '1200',
  'arg11' => '32',
}

p ar = h.keys.sort_by{|s| s[3..-1].to_i}
p h.values_at[*ar]
#=>`[]': wrong number of arguments (12 for 1..2) (ArgumentError)

Where did I mistake?

p h.values_at[*ar]

should be

p h.values_at(*ar)

Jim ruther Nill wrote in post #1107440:

p h.values_at[*ar]

should be

p h.values_at(*ar)

  'arg0' => '126150656000',
  'arg11' => '32',
Posted via http://www.ruby-forum.com/.

--

Thanks! It was a typo.