1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Deprecate include/prepend in refinements and add Refinement#import_methods instead

Refinement#import_methods imports methods from modules.
Unlike Module#include, it copies methods and adds them into the refinement,
so the refinement is activated in the imported methods.

[Bug #17429] [ruby-core:101639]
This commit is contained in:
Shugo Maeda 2021-10-21 16:21:08 +09:00
parent 7185c00fcc
commit 6606597109
No known key found for this signature in database
GPG key ID: 2DFE34085E97CE47
8 changed files with 185 additions and 4 deletions

View file

@ -100,6 +100,14 @@ VALUE rb_define_class_id_under(VALUE outer, ID id, VALUE super);
*/
VALUE rb_module_new(void);
/**
* Creates a new, anonymous refinement.
*
* @return An anonymous refinement.
*/
VALUE rb_refinement_new(void);
/**
* This is a very badly designed API that creates an anonymous module.
*