mirror of
https://github.com/ruby/ruby.git
synced 2026-10-28 16:36:20 +08:00
[DOC] nodoc various classes under Enumerator
They are implementation details: * https://docs.ruby-lang.org/en/4.0/Enumerator/Yielder.html * https://docs.ruby-lang.org/en/4.0/Enumerator/Producer.html * https://docs.ruby-lang.org/en/4.0/Enumerator/Generator.html
This commit is contained in:
1 parent
8267e508c5
commit
5ec634bb4e
2 files changed
+4
-4
Notes:
git
2026-05-19 21:08:58 +00:00
No files matched your search
@@ -5147,7 +5147,7 @@ enum_compact(VALUE obj)
|
||||
* end
|
||||
*
|
||||
* The result of the size function should represent the number of iterations
|
||||
* (i.e., the number of times Enumerator::Yielder#yield is called).
|
||||
* (i.e., the number of times you yield to the block argument).
|
||||
* In the above example, the block calls #yield three times, and
|
||||
* the size function, +-> { 3 }+, returns 3 accordingly.
|
||||
* The result of the size function can be an integer, +Float::INFINITY+,
|
||||
|
||||
+3
-3
@@ -4706,7 +4706,7 @@ InitVM_Enumerator(void)
|
||||
rb_eStopIteration = rb_define_class("StopIteration", rb_eIndexError);
|
||||
rb_define_method(rb_eStopIteration, "result", stop_result, 0);
|
||||
|
||||
/* Generator */
|
||||
/* :nodoc: Generator */
|
||||
rb_cGenerator = rb_define_class_under(rb_cEnumerator, "Generator", rb_cObject);
|
||||
rb_include_module(rb_cGenerator, rb_mEnumerable);
|
||||
rb_define_alloc_func(rb_cGenerator, generator_allocate);
|
||||
@@ -4714,7 +4714,7 @@ InitVM_Enumerator(void)
|
||||
rb_define_method(rb_cGenerator, "initialize_copy", generator_init_copy, 1);
|
||||
rb_define_method(rb_cGenerator, "each", generator_each, -1);
|
||||
|
||||
/* Yielder */
|
||||
/* :nodoc: Yielder */
|
||||
rb_cYielder = rb_define_class_under(rb_cEnumerator, "Yielder", rb_cObject);
|
||||
rb_define_alloc_func(rb_cYielder, yielder_allocate);
|
||||
rb_define_method(rb_cYielder, "initialize", yielder_initialize, 0);
|
||||
@@ -4722,7 +4722,7 @@ InitVM_Enumerator(void)
|
||||
rb_define_method(rb_cYielder, "<<", yielder_yield_push, 1);
|
||||
rb_define_method(rb_cYielder, "to_proc", yielder_to_proc, 0);
|
||||
|
||||
/* Producer */
|
||||
/* :nodoc: Producer */
|
||||
rb_cEnumProducer = rb_define_class_under(rb_cEnumerator, "Producer", rb_cObject);
|
||||
rb_define_alloc_func(rb_cEnumProducer, producer_allocate);
|
||||
rb_define_method(rb_cEnumProducer, "each", producer_each, 0);
|
||||
|
||||
Reference in new issue
Block a user