duck-type values responding to #to_hash or #to_ary#139
Draft
notEthan wants to merge 1 commit intojoshbuddy:masterfrom
Draft
duck-type values responding to #to_hash or #to_ary#139notEthan wants to merge 1 commit intojoshbuddy:masterfrom
notEthan wants to merge 1 commit intojoshbuddy:masterfrom
Conversation
Contributor
Author
|
I hope any maintainers will consider this. that is, a thumbs up that it could be merged/released if I put the rest of the work in to get this PR complete. I've implemented the same changes on jmespath for ruby (jmespath/jmespath.rb#51). I'd like to have both flavors of json querying available as options that are compatible with my library. |
Owner
|
Sorry about the delay. This change makes total sense to me. Looking forward to the PR and thanks! |
Contributor
|
Just a comment on the PR. I think |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I work with JSON data wrapped in classes which behave like Hash and Array, which respond to #to_hash / #to_ary to support implicit conversion (as described in https://docs.ruby-lang.org/en/master/doc/implicit_conversion_rdoc.html )
this PR lets jsonpath be used with these implicitly convertible objects. my goal is to search the wrapped document and get wrapped children out as the result(s).
it is in draft because I have updated no tests, and may be incomplete in other ways. if an active maintainer thinks it is a good idea to merge, I will bring it to completion.