8000 Adjust Refinement#target docs · ruby/ruby@a3473f4 · GitHub
[go: up one dir, main page]

Skip to content

Commit a3473f4

Browse files
committed
Adjust Refinement#target docs
1 parent d33e8af commit a3473f4

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

eval.c

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1346,9 +1346,19 @@ rb_using_module(const rb_cref_t *cref, VALUE module)
13461346

13471347
/*
13481348
* call-seq:
1349-
* target -> class
1349+
* target -> class_or_module
13501350
*
13511351
* Return the class or module refined by the receiver.
1352+
*
1353+
* module M
1354+
* refine String do
1355+
* def indent(level)
1356+
* ' ' * level + self
1357+
* end
1358+
* end
1359+
* end
1360+
*
1361+
* M.refinements[0].target # => String
13521362
*/
13531363
VALUE
13541364
rb_refinement_module_get_refined_class(VALUE module)
@@ -1363,6 +1373,8 @@ rb_refinement_module_get_refined_class(VALUE module)
13631373
* call-seq:
13641374
* refined_class -> class
13651375
*
1376+
* Deprecated; prefer #target.
1377+
*
13661378
* Return the class refined by the receiver.
13671379
*/
13681380
static VALUE

0 commit comments

Comments
 (0)
0