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

Let ArgumentList#each return enumerator unless block given #88

Merged
merged 1 commit into from
Jan 19, 2019

Conversation

denisdefreyne
Copy link
Owner

@denisdefreyne denisdefreyne commented Jan 19, 2019

Calling ArgumentList#each now works even when not passed a block, in which case it will return an Enumerator:

args = Cri::ArgumentList.new(%w[a b c], false, [])
args.each.map(&:upcase) 
# => ['A', 'B', 'C']

Fixes #87.

@denisdefreyne denisdefreyne merged commit 8b74c86 into master Jan 19, 2019
@denisdefreyne denisdefreyne deleted the argument-list-each-enumerator branch January 19, 2019 08:42
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

Successfully merging this pull request may close these issues.

1 participant