each_key()
public
Calls block once for each key in
hsh, passing the key as a parameter.
h = { "a" => 100, "b" => 200 }
h.each_key {|key| puts key }
produces:
a
b
Show source
/*
* call-seq:
* hsh.each_key {| key | block } -> hsh
*
* Calls <i>block</i> once for each key in <i>hsh</i>, passing the key
* as a parameter.
*
* h = { "a" => 100, "b" => 200 }
* h.each_key {|key| puts key }
*
* <em>produces:</em>
*
* a
* b
*/
static VALUE
rb_hash_each_key(hash)
VALUE hash;
{
rb_hash_foreach(hash, each_key_i, 0);
return hash;
}