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
#each(), and #each_with_index() both simply return the collection for Enumerable objects.
But this is a bit weird, as the receiver is the TaskbarProgress object, and the enumerable collection is a parameter. I would still say not to make things work non-rubyish.
(A nitpick is that assigning a reference to the result of a block form method, and then returning it in the next statement is frivolous.)
If you want a block form that returns the ALL block results, it should be named collect(), alias map(), etc.; and select(), find_all(), etc. for filtered results.
The text was updated successfully, but these errors were encountered:
#each()
, and#each_with_index()
both simply return the collection for Enumerable objects.But this is a bit weird, as the receiver is the TaskbarProgress object, and the enumerable collection is a parameter. I would still say not to make things work non-rubyish.
(A nitpick is that assigning a reference to the result of a block form method, and then returning it in the next statement is frivolous.)
If you want a block form that returns the ALL block results, it should be named
collect()
, aliasmap()
, etc.; andselect()
,find_all()
, etc. for filtered results.The text was updated successfully, but these errors were encountered: