Issue #13303 has been updated by mame (Yusuke Endoh).


duerst (Martin Drst) wrote:
> [].any? is always true.

No, it is always false.  I agree that `String#any?` is a bad name for the behavior, anyway.

I think that what Naruse-san really wants is, still, `Object#present?`.

    if h and val = h["value"] and val != ""

    if h and h["value"].present?

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

* 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>