I have a function, which yields few items. I'm iterating them using
my_function() do |item|
... some code here ...
end
Is there a cool way to check if the iterator doesn't return any items? Something like:
my_function() do |item|
... some code here ...
else
puts "No items found"
end