Радар на почту

Показать HN: String#to_proc для упрощения работы с JSON

HN · 13.11.2026 · 23:59

Автор возобновил проект, направленный на упрощение извлечения значений из глубоко вложенных структур, таких как JSON-ответы, с помощью Ruby.

Читать в источнике

Оригинал

Show HN: String#to_proc` to Help Traversing JSON

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(&'*[