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

Adding code/todo_list.rb #2

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

Conversation

costinpapuc
Copy link

No description provided.

@zmack
Copy link
Owner

zmack commented Nov 1, 2015

Foarte mișto. Sper că nu te-ai plictisit prea mult săptămâna asta :octocat:

@costinpapuc
Copy link
Author

Chiar deloc 🌰 :squirrel:

end
def items_done
items.select {|e| e.done?}
end
Copy link
Owner

Choose a reason for hiding this comment

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

apropo:

[1] pry(main)> (1..10).to_a.select(&:odd?)
=> [1, 3, 5, 7, 9]
[2] pry(main)> (1..10).to_a.reject(&:odd?)
=> [2, 4, 6, 8, 10]

Copy link
Author

Choose a reason for hiding this comment

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

Super tare! Exista functie pentru aproape orice 😆. Si devine mai frumos items.reject(&:done?) si items.select(&:done?)

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