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

My enumerable #5

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

nvalchanov96
Copy link

My implementation of enumerable.

# Your code goes here
Array.new.tap do |arr|
each do |element|
arr << element if (yield element) == true
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Няма нужда от сравнението == true

В Ruby всичко е true, освен fasle, и nil

@RadoRado
Copy link

RadoRado commented Dec 3, 2015

Пробвай част от методите да ги имплементираш използвайки другата част от методите, а не само each

Примерно, any? и all? могат ли да се имплементират с filter?

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.

2 participants