You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Iterating over collections (e.g. ReldepList, PackageQuery, ...) in Ruby currently requires a quite unwieldy while loop.
To get elements out of PackageQuery for example:
Iterating over collections (e.g. ReldepList, PackageQuery, ...) in Ruby currently requires a quite unwieldy while loop.
To get elements out of PackageQuery for example:
In idiomatic ruby, the methods from Enumerable module are preferred. The mentioned loop should look like:
For any iterable collection, there are 2 requirements are needed to make use of the enumerable module:
each
that iterates over each element, yielding it in a block.After just these 2 steps we also acquire other methods such as #map, #find, #select, #inject, etc... from Enumerable.
The text was updated successfully, but these errors were encountered: