Hi,
I need but actually don't find how to iterate an iterable collection
in Java-way. It seems generally like this:
Iterator it = objs.iterator();
while (it.hasMore()) {
Object anObj = it.next();
...
}
How can I do it in Ruby? I know objs.each do |anObj| ... end but it's
not (enough) good for me. I want to use additional cycle condition
like this:
boolean b = true;
Iterator it = objs.iterator();
while (b && it.hasMore()) {
Object anObj = it.next();
...
}
What is the equivalent to this in Ruby?
Thanks,
GáÃor