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

[draft] NodeSet is an Array #2617

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft

Conversation

flavorjones
Copy link
Member

What problem is this PR intended to solve?

Draft implementation of NodeSet using an Array for storage, see #2184 for background and context.

Have you included adequate test coverage?

Existing test coverage should be sufficient.

Does this change affect the behavior of either the C or the Java implementations?

Right now this PR just addresses the C implementation to demonstrate the approach and get feedback from CI.

@flavorjones flavorjones marked this pull request as draft August 6, 2022 20:03
@flavorjones flavorjones force-pushed the flavorjones-nodeset-is-an-array branch from 79a1c62 to 6f33bc1 Compare August 7, 2022 15:13
@flavorjones flavorjones force-pushed the flavorjones-nodeset-is-an-array branch from 6f33bc1 to b95f586 Compare August 8, 2022 01:44
@@ -6,70 +6,44 @@ module XML
# A NodeSet contains a list of Nokogiri::XML::Node objects. Typically
# a NodeSet is return as a result of searching a Document via
# Nokogiri::XML::Searchable#css or Nokogiri::XML::Searchable#xpath
class NodeSet
class NodeSet < ::Array
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 think it's going to be better to use DelegateClass(Array) here, see https://rubyapi.org/o/delegator and https://rubyapi.org/3.3/o/object#method-i-DelegateClass

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.

1 participant