Skip to content
onsuggest
Log in
Tool en

Show HN: String#to_proc` to Help Traversing JSON

Source: Show HN ·

I've resuscitated a project I was working on years ago. I was tired of having nested `flat_map` making my code basically unreadable just to fetch a simple value. The idea is to make simple & readable the traversing of deeply nested structures like JSON responses, while staying in Ruby & keeping its flexibility. Here it goes: graphql_response.then(&'[data][repository][issues][edges]*([node][title])') # => ["Support negative indexes", "Document aggregates"] github_prs_response.then(&'*[draft].any?') # => true It's different from jq or JSONPath in that: - it's a Ruby block so you can use it with

What is Show HN: String#to_proc` to Help Traversing JSON?

Show HN: String#to_proc` to Help Traversing JSON is a tool discovery curated from Show HN. I've resuscitated a project I was working on years ago. I was tired of having nested `flat_map` making my code basically unreadable just to fetch a simple value. The idea is to…

How can I access or experience this?

You can experience this content directly on its original host (Show HN) by clicking the "Open Original" button.

Where does this content come from?

Curated from Show HN by the OnSuggest team to surface the most interesting and serendipitous content on the web.

Tool · Developer tools

Show HN: Curation Beats Compaction

Building a harness with a context that's bulk-addressable via familiar pattern primitives empowers local models to succeed with a fraction of the context size and helps all models avoid amnesia entirely on long-running sessions. Comments URL: https://news.ycombinator.com/item?id=50579653 Points: 1 # Comments: 0

Keyboard shortcuts

Previous discovery
←P
Next discovery
→N
Like
L
Not for me
X
Save
S
Show this help
?
Close
Esc

Shortcuts work on the discovery page.