4 # obj.tap{|x|...} -> obj
6 # Yields <code>x</code> to the block, and then returns <code>x</code>.
7 # The primary purpose of this method is to "tap into" a method chain,
8 # in order to perform operations on intermediate results within the chain.
10 # (1..10) .tap {|x| puts "original: #{x.inspect}"}
11 # .to_a .tap {|x| puts "array: #{x.inspect}"}
12 # .select {|x| x%2==0} .tap {|x| puts "evens: #{x.inspect}"}
13 # .map { |x| x*x } .tap {|x| puts "squares: #{x.inspect}"}