General

Profile

meisel (Michael Eisel)

  • Login: meisel
  • Registered on: 06/17/2021
  • Last sign in: 09/29/2021

Issues

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

Activity

09/02/2021

05:52 PM Ruby Feature #13683: Add strict Enumerable#single
+1 for this, I've needed it in many cases, generally where I have to select an element from a set and there's no stable/documented way of doing this. So, I find some criteria that seem to work, but would like to protect against my criter... meisel (Michael Eisel)
05:44 PM Ruby Feature #18135: Introduce Enumerable#detect_only
Yes, I meant `... != 1`, thanks. And I think we can close this issue, and I'll add my thoughts to the issue that this dupes. meisel (Michael Eisel)

09/01/2021

02:52 PM Ruby Feature #18135: Introduce Enumerable#detect_only
Also, another alternative could be `Enumerable#take_only`, where it takes the only element from the enumerable or else fails. So instead of:
```
array.detect_only { |elem| some_method(elem) }
```
We'd have:
```
array.select { |...
meisel (Michael Eisel)

08/26/2021

07:18 PM Ruby Feature #18135 (Open): Introduce Enumerable#detect_only
It can be important to get the only element for which a block returns true, and to assert that this is the only element as such. For example, this can be a very helpful sanity check when one is working with data that's outside of their c... meisel (Michael Eisel)

Also available in: Atom