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

Comply with guide for method doc: array.c #3475

Merged
merged 2 commits into from Aug 30, 2020
Merged

Comply with guide for method doc: array.c #3475

merged 2 commits into from Aug 30, 2020

Conversation

BurdetteLamar
Copy link
Member

Methods considered:

  • bsearch
  • bsearch_index
  • sort_by!
  • collect
  • collect!
  • values_at
  • select
  • select!
  • keep_if
  • delete

@BurdetteLamar
Copy link
Member Author

@jeremyevans, did not work on my machine.

@BurdetteLamar BurdetteLamar added the Documentation Improvements to documentation. label Aug 29, 2020
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. I have one recommendation regarding map/collect, but it's up to you.

@@ -3473,25 +3462,21 @@ rb_ary_sort_by_bang(VALUE ary)

/*
* call-seq:
* array.map {|element| ... } -> new_array
* array.map -> new_enumerator
Copy link
Contributor

Choose a reason for hiding this comment

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

In the Ruby code I've seen, map is more popular than collect, so I would make that the primary method, use it in the examples, and say that collect is an alias for map. Same goes for map!. But maybe that is just my personal preference.

Copy link
Member Author

Choose a reason for hiding this comment

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

Personally, I agree. I was just looking at C function names: rb_ary_select, rb_ary_select_bang. If no one objects, I'll change them.

@BurdetteLamar BurdetteLamar merged commit 585a659 into ruby:master Aug 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation Improvements to documentation.
2 participants