keys()
public
Returns a new array populated with the
keys from this hash. See also Hash#values.
h = { "a" => 100, "b" => 200, "c" => 300, "d" => 400 }
h.keys
Show source
/*
* call-seq:
* hsh.keys => array
*
* Returns a new array populated with the keys from this hash. See also
* <code>Hash#values</code>.
*
* h = { "a" => 100, "b" => 200, "c" => 300, "d" => 400 }
* h.keys
*
*/
static VALUE
rb_hash_keys(hash)
VALUE hash;
{
VALUE ary;
ary = rb_ary_new();
rb_hash_foreach(hash, keys_i, ary);
return ary;
}