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

Project: Custom Enumerables: Added link to Additional resources list #28277

Merged
merged 2 commits into from
Jun 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions ruby/advanced_ruby/project_custom_enumerables.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
### Introduction

You should be very familiar with the Enumerable module that gets mixed into the Array and Hash classes (among others) and provides you with lots of handy iterator methods. To prove that there's no magic to it, you're going to rebuild those methods.

We will explain an example of how an enumerable works to give you an idea of how to start tackling these methods. Specifically we're going to break down the `#find` enumerable method. The `#find` method finds the first element that matches the given block's condition and returns it. If one isn't found, it returns `nil`.
Expand Down Expand Up @@ -37,16 +38,17 @@ With `self.each`, we're calling the `#each` method on the object instance that's
If the block returns `true`/truthy for an element, we immediately `return` that element. If nothing is found, we'll iterate all the way through the array and end up executing the `nil` return at the very end. Pretty cool, huh? Now it's time for you to practice:

### Assignment

<div class="lesson-content__panel" markdown="1">

1. Fork and clone our [custom enumerables repo](https://github.com/TheOdinProject/custom_enumerable_project)
2. Follow the [instructions in the README](https://github.com/TheOdinProject/custom_enumerable_project#installation) to get the repo setup locally
3. Rebuild each of [the methods in this table](https://github.com/TheOdinProject/custom_enumerable_project#methods) and make sure they all pass the tests associated with them.
1. Follow the [instructions in the README](https://github.com/TheOdinProject/custom_enumerable_project#installation) to get the repo setup locally
1. Rebuild each of [the methods in the table at the end of the README](https://github.com/TheOdinProject/custom_enumerable_project#methods) and make sure they all pass the tests associated with them.

</div>

### Additional resources

This section contains helpful links to related content. It isn't required, so consider it supplemental.

- It looks like this lesson doesn't have any additional resources yet. Help us expand this section by contributing to our curriculum.
- Jason Mattingly has a useful article on [Writing Your Own Enumerables in Ruby](https://jsonmattingly.medium.com/writing-your-own-enumerables-in-ruby-18db4fa0e5fe).
Loading