class Object

not pulling in active-support JUST for this method.

def tap

tap { |x| puts "squares: #{x.inspect}" }
map { |x| x*x }.
tap { |x| puts "evens: #{x.inspect}" }.
select { |x| x%2 == 0 }.
tap { |x| puts "array: #{x.inspect}" }.
(1..10).tap { |x| puts "original: #{x.inspect}" }.to_a.

in order to perform operations on intermediate results within the chain.
The primary purpose of this method is to "tap into" a method chain,
Yields x to the block, and then returns x.
def tap
  yield self
  self
end unless Object.respond_to?(:tap)