-
-
Notifications
You must be signed in to change notification settings - Fork 901
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
Introduce support for keyword arguments #3323
Comments
For an example of the kind of documentation I'd like to see, take a look at #3324 which updates |
The list of methods that need to be updated is at https://docs.google.com/spreadsheets/d/1pWM7N5D9073J8IRVO0yghIySTYhsJoO73sslAVxEO-A/edit?gid=0#gid=0 We'll work on this for RubyConf 2024 hack day! |
**What problem is this PR intended to solve?** Related to #3323, introducing keyword argument support in `XML::Document.parse`. **Have you included adequate test coverage?** Some minor test coverage introduced. **Does this change affect the behavior of either the C or the Java implementations?** n/a
TODO: link back to this issue in doc strings for people to discover some documentation about the positional arguments |
**What problem is this PR intended to solve?** #3323 **Have you included adequate test coverage?** No new behavior has been added, so existing tests are sufficient. **Does this change affect the behavior of either the C or the Java implementations?** No.
The Nokogiri API was largely designed and implemented for Ruby 1.9, which pre-dates keyword argument support and parameter forwarding with
...
. As a result, many methods are using positional arguments where keyword arguments are probably better.For example,
Nokogiri::XML::Document.parse
is declared as:I would like to update these method signatures to support keyword arguments without dropping support (yet) for positional arguments. In the case of
Document.parse
, this might look like:I would also like to update the docstrings to describe the keyword arguments, and remove documentation for the positional arguments.
Another example is
Nokogiri::XML()
which is defined as:Methods that are forwarding positional arguments should be updated to more cleanly forward either keyword arguments or positional arguments, and avoid redeclaring parameter default values:
The text was updated successfully, but these errors were encountered: