Skip to content

Enhanced RDoc for JSON.dump#443

Merged
hsbt merged 2 commits intoruby:masterfrom
BurdetteLamar:rdoc
Aug 14, 2020
Merged

Enhanced RDoc for JSON.dump#443
hsbt merged 2 commits intoruby:masterfrom
BurdetteLamar:rdoc

Conversation

@BurdetteLamar
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Member

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

@BurdetteLamar
Copy link
Copy Markdown
Member Author

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

@BurdetteLamar
Copy link
Copy Markdown
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
Copy Markdown
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