mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
d4c22161f3
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48115 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
14 lines
272 B
C
14 lines
272 B
C
#include "ruby.h"
|
|
|
|
static VALUE
|
|
hash_delete(VALUE hash, VALUE key)
|
|
{
|
|
VALUE ret = rb_hash_delete(hash, key);
|
|
return ret == Qundef ? Qnil : rb_ary_new_from_values(1, &ret);
|
|
}
|
|
|
|
void
|
|
Init_delete(VALUE klass)
|
|
{
|
|
rb_define_method(klass, "delete!", hash_delete, 1);
|
|
}
|