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