Should be an easy one. I thought, from reading this blog post that I could return something right after my next command:
next "new value" if axis_range == "test"
What I’d really like to do is log the reason for the next on the same line:
next @logger.info('skipping this item because for fun') unless (elephants.size > 0)
I can’t find any discussion of this usage of next on ruby doc. The code certainly works. I realize I can do this with an unless block but the that line of code is sooo concise.
Two questions:
- Is there a better document somewhere?
- Is this usage of
nexta little odd and not ‘ruby-ish’?
The book gives this example:
and this alternative: