I came across this construction in a gem and don't understand the intent. I know what tap does alone, but why would someone call super.tap {} instead of just continuing the code normally after the super call.
def my_method
super.tap do |u|
if @user && @user.new_record?
@omniauth = u.session[:session]
u.session[:omniauth] = nil unless @user.new_record?
end
end
end
Can anyone enlighten me?