From: "AaronLasseigne (Aaron Lasseigne)" Date: 2012-03-21T09:16:29+09:00 Subject: [ruby-core:43505] [ruby-trunk - Feature #6180] to_b for converting objects to a boolean value Issue #6180 has been updated by AaronLasseigne (Aaron Lasseigne). Typically this comes up when you have a method ending in a question mark to indicate a boolean return value. def foo? !!@foo end def has_vowel? !!(value =~ /[aeiou]/) end ---------------------------------------- Feature #6180: to_b for converting objects to a boolean value https://bugs.ruby-lang.org/issues/6180#change-24986 Author: AaronLasseigne (Aaron Lasseigne) Status: Open Priority: Normal Assignee: Category: Target version: When a boolean return value is required it has become common practice is to use "!!" to convert the object. It would be more consistent to provide a "to_b" method on Object. -- http://bugs.ruby-lang.org/