That is simple.
Just add a semicolon(;
) at end of the statement/expression in Ruby whose return value you don't want to see and also add nil
.
Make it:
[1,2].each {|u| puts "hey"}; nil
But please note that there is no reason to suppress the irb
output(except when the return value is too large/lot of text); it helps a lot in debugging and to know what exactly is going on in the function.