I am reviewing a piece of code from a Rails project and I came across the tap method. What does it do?
tap
Also, it would be great if someone could help me
Tap is a Ruby method from the Object class.
This method yields x to the block and then returns x. This method is used to "tap into" a method chain, to perform operations on intermediate results within the chain.