open(*args)
public
Open a dbm database and yields it if a
block is given. See also DBM.new.
static VALUE
fdbm_s_open(int argc, VALUE *argv, VALUE klass)
{
VALUE obj = fdbm_alloc(klass);
if (NIL_P(fdbm_initialize(argc, argv, obj))) {
return Qnil;
}
if (rb_block_given_p()) {
return rb_ensure(rb_yield, obj, fdbm_close, obj);
}
return obj;
}