Ruby Newbie homepage Ruby Newbie homepage

How to use

Quick guide

Official content
Sets the default value to value; returns value:
h = {}
h.default # => nil
h.default = false # => false
h.default # => false
 
               static VALUE
rb_hash_set_default(VALUE hash, VALUE ifnone)
{
    rb_hash_modify_check(hash);
    SET_DEFAULT(hash, ifnone);
    return ifnone;
}
            

Was this page useful?