APIdock / Ruby
/
method

using

ruby latest stable - Class: Module
using(p1)
private

Import class refinements from module into the current class or module definition.

static VALUE
mod_using(VALUE self, VALUE module)
{
 rb_control_frame_t *prev_cfp = previous_frame(GET_EC());
 if (prev_frame_func()) {
 rb_raise(rb_eRuntimeError,
 "Module#using is not permitted in methods");
 }
 if (prev_cfp && prev_cfp->self != self) {
 rb_raise(rb_eRuntimeError, "Module#using is not called on self");
 }
 if (rb_block_given_p()) {
 ignored_block(module, "Module#");
 }
 rb_using_module(rb_vm_cref_replace_with_duplicated_cref(), module);
 return self;
}

AltStyle によって変換されたページ (->オリジナル) /