From: Marc-Andre Lafortune Date: 2009-04-17T14:00:16+09:00 Subject: [ruby-core:23228] [Bug #1385] Wonderful undocumented feature in Ruby 1.8.7 & 1.9 Issue #1385 has been updated by Marc-Andre Lafortune. As pointed out by Joel VanderWerf, my second usage example is wrong (it takes commas instead of =>). It should read: /* * call-seq: * Hash[ key, value, ... ] => hash * Hash[ [ [key, value], ... ] ] => hash * Hash[ object ] => hash * * Creates a new hash populated with the given objects. Equivalent to * the literal { key => value, ... }. In the first * form, keys and values occur in pairs, so there must be an even number of arguments. * The second and third form take a single argument which is either * an array of key-value pairs or an object convertible to a hash. * * Hash["a", 100, "b", 200] #=> {"a"=>100, "b"=>200} * Hash[ [ ["a", 100], ["b", 200] ] ] #=> {"a"=>100, "b"=>200} * Hash["a" => 100, "b" => 200] #=> {"a"=>100, "b"=>200} * {"a" => 100, "b" => 200} #=> {"a"=>100, "b"=>200} */ Sorry! ---------------------------------------- http://redmine.ruby-lang.org/issues/show/1385 ---------------------------------------- http://redmine.ruby-lang.org