Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#each iterator #4

Open
DanRathbun opened this issue May 16, 2016 · 0 comments
Open

#each iterator #4

DanRathbun opened this issue May 16, 2016 · 0 comments

Comments

@DanRathbun
Copy link

#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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant