diff options
| -rw-r--r-- | ChangeLog | 5 | ||||
| -rw-r--r-- | object.c | 13 |
2 files changed, 14 insertions, 4 deletions
@@ -1,3 +1,8 @@ +Tue Apr 22 16:44:00 2008 Kazuhiro NISHIYAMA <zn@mbf.nifty.com> + + * object.c (rb_obj_tap): Correct documentation; pointed out by + okkez in [ruby-dev:34472]. + Tue Apr 22 10:05:51 2008 NAKAMURA Usaku <usa@ruby-lang.org> * file.c (eaccess): workaround for recent msvcrt's behavior. @@ -502,10 +502,15 @@ rb_obj_is_kind_of(obj, c) * The primary purpose of this method is to "tap into" a method chain, * in order to perform operations on intermediate results within the chain. * - * (1..10) .tap {|x| puts "original: #{x.inspect}"} - * .to_a .tap {|x| puts "array: #{x.inspect}"} - * .select {|x| x%2==0} .tap {|x| puts "evens: #{x.inspect}"} - * .map { |x| x*x } .tap {|x| puts "squares: #{x.inspect}"} + * (1..10).tap { + * |x| puts "original: #{x.inspect}" + * }.to_a.tap { + * |x| puts "array: #{x.inspect}" + * }.select {|x| x%2==0}.tap { + * |x| puts "evens: #{x.inspect}" + * }.map {|x| x*x}.tap { + * |x| puts "squares: #{x.inspect}" + * } * */ |
