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

Adding #fetch support to XML::Node ? #765

Closed
andyw8 opened this issue Sep 21, 2012 · 3 comments
Closed

Adding #fetch support to XML::Node ? #765

andyw8 opened this issue Sep 21, 2012 · 3 comments

Comments

@andyw8
Copy link

andyw8 commented Sep 21, 2012

The docs say

A Nokogiri::XML::Node may be treated similarly to a hash with regard to attributes.

but one thing I miss from this hash-like behaviour is #fetch, which would raise an error if the given key doesn't exist. This can be helpful for avoiding nils being inadvertently passed around, leading to hard-to-find bugs.

Would this be worth adding?

@flavorjones
Copy link
Member

Howdy! Thanks for bringing this up.

If you take a look at the roadmap for Nokogiri 2.0 (https://github.com/sparklemotion/nokogiri/blob/master/ROADMAP.md) you'll see that we definitely want to make the Node API better, particularly around attribute-hashiness (also see issue #666).

I'll add a reference to this issue in the roadmap, and leave this open for now. Cool?

@andyw8
Copy link
Author

andyw8 commented Sep 22, 2012

Great, thanks.

@flavorjones
Copy link
Member

I've noted this in the ROADMAP doc and as I approach what might be a 2.0 release later this year or early next year, I'm keeping this topic top-of-mind. However, in the meantime to lower the cognitive overhead of the backlog, I'm going to close this.

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

No branches or pull requests

2 participants