diff options
author | kazu <kazu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-04-22 07:47:11 +0000 |
---|---|---|
committer | kazu <kazu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-04-22 07:47:11 +0000 |
commit | e103da4e613d82220bcabed60f5b86df3ff288d8 (patch) | |
tree | 95415e5e2b31b24cdd3efecc82422770cae86b65 /object.c | |
parent | a634d040f05475114670d2b6f7315bdc6b2690a3 (diff) |
* object.c (rb_obj_tap): Correct documentation; pointed out by
okkez in [ruby-dev:34472].
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@16142 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'object.c')
-rw-r--r-- | object.c | 13 |
1 files changed, 9 insertions, 4 deletions
@@ -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}" + * } * */ |