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

[DOC] Enhanced RDoc for MatchData #5822

Merged
merged 3 commits into from
Apr 18, 2022
Merged

[DOC] Enhanced RDoc for MatchData #5822

merged 3 commits into from
Apr 18, 2022

Conversation

BurdetteLamar
Copy link
Member

Treats:

  • #to_s
  • #named_captures
  • #string
  • #inspect
  • #hash
  • #==

Also some very minor housekeeping.

@BurdetteLamar BurdetteLamar added the Documentation Improvements to documentation. label Apr 18, 2022
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 mostly good, a few minor changes requested.

re.c Outdated Show resolved Hide resolved
re.c Show resolved Hide resolved
re.c Outdated Show resolved Hide resolved
re.c Outdated
* #=> #<MatchData "o">
* /(.)(.)(.)/.match("foo")
* # => #<MatchData "foo" 1:"f" 2:"o" 3:"o">
* m.inspect # => "#<MatchData \"o\">"
Copy link
Contributor

Choose a reason for hiding this comment

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

This line and other m.inspect lines below look wrong.

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed.

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. There is one example block that should be deleted, after that this can be merged without additional review.

re.c Outdated
*
* puts /(?<foo>.)(?<bar>.)(?<baz>.)/.match("hoge").inspect
* #=> #<MatchData "hog" foo:"h" bar:"o" baz:"g">
* m = /(?<foo>.)(?<bar>.)(?<baz>.)/
Copy link
Contributor

Choose a reason for hiding this comment

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

This example block shows Regexp#inspect, not MatchData#inspect, so I think it should be removed.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

@BurdetteLamar BurdetteLamar merged commit b41de3a into ruby:master Apr 18, 2022
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