Issue #13303 has been updated by MSP-Greg (Greg L).


After some more thought (and the desire for a method name that could be used with other objects), I think

`#each?`

might work for many objects, including those that inherit/include `Enumerable`.

Simply defined, `each?` returns `true` if an `#each` block will be performed at least once.  Nothing about the values, just their existence.  It's also rather short...

----------------------------------------
Feature #13303: String#any? as !String#empty?
https://bugs.ruby-lang.org/issues/13303#change-64362

* Author: naruse (Yui NARUSE)
* Status: Feedback
* Priority: Normal
* Assignee: matz (Yukihiro Matsumoto)
* Target version: 
----------------------------------------
Once I proposed "some container#nonempty?" on #12075, and understand there's Array#any?.

Today I found String doesn't have such method.



-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>