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 JSON.dump #443

Merged
merged 2 commits into from
Aug 14, 2020
Merged

Enhanced RDoc for JSON.dump #443

merged 2 commits into from
Aug 14, 2020

Conversation

BurdetteLamar
Copy link
Member

No description provided.

# JSON.dump(obj, io = nil, limit = nil)
#
# Constructs a \JSON \String from +obj+ by calling
# JSON.generate(obj, JSON.dump_default_options.merge(:max_nesting => limit))
Copy link
Member

Choose a reason for hiding this comment

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

How about translating this to words? Note: IIRC, JSON is also a module that can be included, so the call sequence isn't necessarily JSON.dump, and it calls generate, which may or may not be JSON.generate depending on how dump is called, right?

Copy link
Member Author

Choose a reason for hiding this comment

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

Suggested words, please?

Module/class issue is a serious oversight on my part. The only two example calls in the existing doc use JSON.parse and JSON.generate, and I followed that convention.

This is the last method in JSON that I'm 'enhancing,' and it, like the others, uses the class methods in its examples.

The doc for all the methods should be revised to take the 'duality' into account; the introductory material should also address this.

I suggest we merge with the calls as is for now, and figure out a good way to do better, afterwards.

Copy link
Member Author

Choose a reason for hiding this comment

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

I've restored the original first sentence.

Copy link
Member

@marcandre marcandre left a comment

Choose a reason for hiding this comment

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

Looks really good, I have just one comment

@marcandre
Copy link
Member

Thank you. Either @hsbt chooses "Squash commits", or you squash the two commits together.

@BurdetteLamar
Copy link
Member Author

@hsbt, I think this one's ready to squash and merge.

@BurdetteLamar
Copy link
Member Author

@marcandre, is there an example of a properly documented class/module I can refer to, so I can see how to doc here?

@marcandre
Copy link
Member

@marcandre, is there an example of a properly documented class/module I can refer to, so I can see how to doc here?

I'm not sure there is a "perfect" example I can point to (if I understood your question correctly)

@hsbt hsbt merged commit 03f1699 into ruby:master Aug 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants