From db50b6d59e277ac93904f275da94e3da31709157 Mon Sep 17 00:00:00 2001 From: Midlife Mechanicus <42699076+MidlifeMechanicus@users.noreply.github.com> Date: Wed, 26 Jun 2024 09:59:49 +0100 Subject: [PATCH 1/2] Update project_custom_enumerables.md Added a link to an article that I found very helpful in getting me started on the project. --- ruby/advanced_ruby/project_custom_enumerables.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ruby/advanced_ruby/project_custom_enumerables.md b/ruby/advanced_ruby/project_custom_enumerables.md index 6e68f76df22..6fa0e8b93a7 100644 --- a/ruby/advanced_ruby/project_custom_enumerables.md +++ b/ruby/advanced_ruby/project_custom_enumerables.md @@ -49,4 +49,4 @@ If the block returns `true`/truthy for an element, we immediately `return` that 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). From 3d5299322352be65735d1d39ed2066be79b5367d Mon Sep 17 00:00:00 2001 From: Midlife Mechanicus <42699076+MidlifeMechanicus@users.noreply.github.com> Date: Wed, 26 Jun 2024 20:26:08 +0100 Subject: [PATCH 2/2] Update project_custom_enumerables.md Address linting issues raised in #28277 - Insert additional blank line below headings 'Introduction' and 'Assignment. - Insert blank line above html tag. - Amend ordered list to always use 1. as prefix. - Improve link text description to avoid use of 'this'. --- ruby/advanced_ruby/project_custom_enumerables.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ruby/advanced_ruby/project_custom_enumerables.md b/ruby/advanced_ruby/project_custom_enumerables.md index 6fa0e8b93a7..452f19472aa 100644 --- a/ruby/advanced_ruby/project_custom_enumerables.md +++ b/ruby/advanced_ruby/project_custom_enumerables.md @@ -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`. @@ -37,11 +38,12 @@ 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 +
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.