inspect()
public
Return the contents of this hash as a string.
Show source
/*
* call-seq:
* hsh.inspect => string
*
* Return the contents of this hash as a string.
*/
static VALUE
rb_hash_inspect(hash)
VALUE hash;
{
if (RHASH(hash)->tbl == 0 || RHASH(hash)->tbl->num_entries == 0)
return rb_str_new2("{}");
if (rb_inspecting_p(hash)) return rb_str_new2("{...}");
return rb_protect_inspect(inspect_hash, hash, 0);
}