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

* enumerator.c (yielder_yield_push): Yielder#<< should return self.

[ruby-dev:39660]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25721 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
mame 2009-11-11 16:32:34 +00:00
parent d9eae80011
commit 61ec623860
2 changed files with 13 additions and 1 deletions

View file

@ -1,3 +1,8 @@
Thu Nov 12 01:29:15 2009 Yusuke Endoh <mame@tsg.ne.jp>
* enumerator.c (yielder_yield_push): Yielder#<< should return self.
[ruby-dev:39660]
Wed Nov 11 19:17:35 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
* lib/tempfile.rb (Tempfile#initialize): merge mode option.

View file

@ -1012,6 +1012,13 @@ yielder_yield(VALUE obj, VALUE args)
return rb_proc_call(ptr->proc, args);
}
/* :nodoc: */
static VALUE yielder_yield_push(VALUE obj, VALUE args)
{
yielder_yield(obj, args);
return obj;
}
static VALUE
yielder_yield_i(VALUE obj, VALUE memo, int argc, VALUE *argv)
{
@ -1228,7 +1235,7 @@ Init_Enumerator(void)
rb_define_alloc_func(rb_cYielder, yielder_allocate);
rb_define_method(rb_cYielder, "initialize", yielder_initialize, 0);
rb_define_method(rb_cYielder, "yield", yielder_yield, -2);
rb_define_method(rb_cYielder, "<<", yielder_yield, -2);
rb_define_method(rb_cYielder, "<<", yielder_yield_push, -2);
id_rewind = rb_intern("rewind");
id_each = rb_intern("each");