General

Profile

cb341 (Daniel Bengl)

  • Login: cb341
  • Registered on: 08/15/2025
  • Last sign in: 08/26/2025

Issues

open closed Total
Assigned issues 0 0 0
Reported issues 1 0 1

Activity

08/26/2025

06:39 AM Ruby Feature #21545: #try_dig, a dig that returns early if it cannot dig deeper
herwin (Herwin W) wrote in #note-7:
> Maybe I'm reading too much into the examples, but this looks to me like something where pattern matching would be more suitable:
> ...
This is a beautiful solution to the API problem. I see how thi...
cb341 (Daniel Bengl)
06:37 AM Ruby Feature #21545: #try_dig, a dig that returns early if it cannot dig deeper
Dan0042 (Daniel DeLorme) wrote in #note-6:
> I have never seen an API that can return either a string `"ok"` or a hash `{ code: 200 }`
> ...
Maybe the API status example is not the best suited one for `try_dig`. It has been m...
cb341 (Daniel Bengl)
06:20 AM Ruby Feature #21545: #try_dig, a dig that returns early if it cannot dig deeper
matz (Yukihiro Matsumoto) wrote in #note-5:
> How about adding keyword argument, e.g. `exception: true` to behave `try_dig`.
> ...
Why would you add the option? The thought behind `try_dig` is that there is no exception when you dig to...
cb341 (Daniel Bengl)
06:18 AM Ruby Feature #21545: #try_dig, a dig that returns early if it cannot dig deeper
matheusrich (Matheus Richard) wrote in #note-4:
> Just want to point out that Ruby itself doesn't have any concept of `try`. This *might* be best as a proposal for Active Support.
It does make more sense to have this part of Active S...
cb341 (Daniel Bengl)

08/15/2025

09:36 AM Ruby Feature #21545 (Open): #try_dig, a dig that returns early if it cannot dig deeper
Ruby offers `dig` for traversing nested hashes and arrays. It is strict and will raise if an intermediary object does not support `dig`. In many cases we only want to attempt the lookup and return `nil` if it cannot be followed, without ... cb341 (Daniel Bengl)

Also available in: Atom