+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)
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)
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)