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 1 commit
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
2 changes: 1 addition & 1 deletion ruby/advanced_ruby/project_custom_enumerables.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
### Introduction

Check failure on line 1 in ruby/advanced_ruby/project_custom_enumerables.md

View workflow job for this annotation

GitHub Actions / Lint project files

Headings should be surrounded by blank lines

ruby/advanced_ruby/project_custom_enumerables.md:1 MD022/blanks-around-headings Headings should be surrounded by blank lines [Expected: 1; Actual: 0; Below] [Context: "### Introduction"] https://github.com/DavidAnson/markdownlint/blob/v0.32.1/doc/md022.md
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 @@ -36,12 +36,12 @@

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

Check failure on line 39 in ruby/advanced_ruby/project_custom_enumerables.md

View workflow job for this annotation

GitHub Actions / Lint project files

Headings should be surrounded by blank lines

ruby/advanced_ruby/project_custom_enumerables.md:39 MD022/blanks-around-headings Headings should be surrounded by blank lines [Expected: 1; Actual: 0; Below] [Context: "### Assignment"] https://github.com/DavidAnson/markdownlint/blob/v0.32.1/doc/md022.md
<div class="lesson-content__panel" markdown="1">

Check failure on line 40 in ruby/advanced_ruby/project_custom_enumerables.md

View workflow job for this annotation

GitHub Actions / Lint project files

Multiline HTML tags should be surrounded by blank lines or code block delimiters

ruby/advanced_ruby/project_custom_enumerables.md:40 TOP005/blanks-around-multiline-html-tags Multiline HTML tags should be surrounded by blank lines or code block delimiters [ Expected blank lines/code block delimiters: { Before: 1, After: 1 } Actual blank lines/code block delimiters: { Before: 0, After: 1 } ] [Context: "<div class="lesson-content__panel" markdown="1">"] https://github.com/TheOdinProject/curriculum/blob/main/markdownlint/docs/TOP005.md

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

Check failure on line 43 in ruby/advanced_ruby/project_custom_enumerables.md

View workflow job for this annotation

GitHub Actions / Lint project files

Ordered lists must always use 1. as a prefix (lazy numbering)

ruby/advanced_ruby/project_custom_enumerables.md:43 TOP010/lazy-numbering-for-ordered-lists Ordered lists must always use 1. as a prefix (lazy numbering) [ Expected: "1" Actual: "2" ] https://github.com/TheOdinProject/curriculum/blob/main/markdownlint/docs/TOP010.md
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.

Check failure on line 44 in ruby/advanced_ruby/project_custom_enumerables.md

View workflow job for this annotation

GitHub Actions / Lint project files

Links have descriptive text labels

ruby/advanced_ruby/project_custom_enumerables.md:44 TOP001/descriptive-link-text Links have descriptive text labels [Expected text to not include the words "this" or "here". Use a more descriptive text that clearly conveys the purpose or content of the link.] [Context: "[the methods in this table](https://github.com/TheOdinProject/custom_enumerable_project#methods)"] https://github.com/TheOdinProject/curriculum/blob/main/markdownlint/docs/TOP001.md

Check failure on line 44 in ruby/advanced_ruby/project_custom_enumerables.md

View workflow job for this annotation

GitHub Actions / Lint project files

Ordered lists must always use 1. as a prefix (lazy numbering)

ruby/advanced_ruby/project_custom_enumerables.md:44 TOP010/lazy-numbering-for-ordered-lists Ordered lists must always use 1. as a prefix (lazy numbering) [ Expected: "1" Actual: "3" ] https://github.com/TheOdinProject/curriculum/blob/main/markdownlint/docs/TOP010.md

</div>

Expand All @@ -49,4 +49,4 @@

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