Skip to content

Enhanced RDoc for Struct #4890

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

Merged
merged 2 commits into from
Sep 24, 2021
Merged

Enhanced RDoc for Struct #4890

merged 2 commits into from
Sep 24, 2021

Conversation

BurdetteLamar
Copy link
Member

Treated:

  • #each
  • #each_pair
  • #inspect
  • #to_a
  • #to_h
  • #[]
  • #[]=

@BurdetteLamar BurdetteLamar added the Documentation Improvements to documentation. label Sep 24, 2021
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.

Thanks for working on this. Only a few requests for changes.

* struct[member] -> object
* struct[index] -> object
* struct[name] -> object
* struct[n] -> object
Copy link
Contributor

Choose a reason for hiding this comment

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

I would use a single line with key instead of name and n. From a caller's perspective, the two lines are the same. Same change for []=

Copy link
Member Author

Choose a reason for hiding this comment

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

These two forms seem different to me.

More importantly, replacing name and n with key would force some clumsiness into the discussion:

  • +key+th or something perhaps worse.
  • Raises NameError if +key+ is not an integer or a member name.
  • Raises IndexError if +key+ is an integer that is out of range.

I'd prefer to leave stet.

Copy link
Contributor

Choose a reason for hiding this comment

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

Since this is just a preference on my part, I'm fine leaving as-is.

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!

@BurdetteLamar BurdetteLamar merged commit bbdfce9 into ruby:master Sep 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation Improvements to documentation.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants