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

Enhanced RDoc for Enumerable #4918

Merged
merged 3 commits into from Oct 1, 2021
Merged

Enhanced RDoc for Enumerable #4918

merged 3 commits into from Oct 1, 2021

Conversation

BurdetteLamar
Copy link
Member

Treats:

  • #zip
  • #take
  • #take_while

@BurdetteLamar BurdetteLamar added the Documentation Improvements to documentation. label Sep 30, 2021
@BurdetteLamar
Copy link
Member Author

BurdetteLamar commented Sep 30, 2021

@jeremyevans, thoughts:

  • Some of the dummy arguments to blocks could be more helpful; e.g. i or pair instead of element.
  • No method name has 'element', but a couple have 'entry' or 'entries'. Should we be saying 'entry' throughout?

Copy link
Contributor

@jeremyevans jeremyevans left a comment

Choose a reason for hiding this comment

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

Looks good! Only a couple of minor changes requested for the zip call-seq.

enum.c Outdated Show resolved Hide resolved
enum.c Outdated Show resolved Hide resolved
@BurdetteLamar
Copy link
Member Author

@jeremyevans, thoughts:

* Some of the dummy arguments to blocks could be more helpful;  e.g. i or pair instead of element.

* No method name has 'element', but a couple have 'entry' or 'entries'.  Should we be saying 'entry' throughout?

@jeremyevans, any thoughts on these?

@jeremyevans
Copy link
Contributor

@jeremyevans, thoughts:

* Some of the dummy arguments to blocks could be more helpful;  e.g. i or pair instead of element.

* No method name has 'element', but a couple have 'entry' or 'entries'.  Should we be saying 'entry' throughout?

@jeremyevans, any thoughts on these?

No strong feelings about either.

Copy link
Contributor

@jeremyevans jeremyevans left a comment

Choose a reason for hiding this comment

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

The Miscellaneous checks CI is failing due to trailing spaces added in the zip call-seq, so you need to fix that before merging:

enum.c:3171: *    zip(*other_enums) → array
enum.c:3172: *    zip(*other_enums) {|array| ... } → nil

After that is fixed and CI passes, OK to merge without further review.

@BurdetteLamar BurdetteLamar merged commit 27d9935 into ruby:master Oct 1, 2021
* r.take(2) # => [1, 2]
* r.take(0) # => []
*
* h = {foo:0, bar: 1, baz: 2, bat: 3}

Choose a reason for hiding this comment

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

Please add space between first key and value

Copy link
Member Author

Choose a reason for hiding this comment

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

Added.

Comment on lines +3340 to 3342
* a = h.take_while{|element| key, value = *element; value < 2 }
* a # => [[:foo, 0], [:bar, 1]]
*

Choose a reason for hiding this comment

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

a variable not needed in these two lines, please remove it.

Copy link
Member Author

Choose a reason for hiding this comment

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

Removed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation Improvements to documentation.
3 participants