method

[]

Importance_1
Ruby latest stable (v1_8_7_72) - 0 notes - Class: Hash
[](...) public

Creates a new hash populated with the given objects. Equivalent to the literal { key, value, ... }. Keys and values occur in pairs, so there must be an even number of arguments.

   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}
Show source
Register or log in to add new notes.