Issue #6180 has been updated by drbrain (Eric Hodel).


It is even shorter if you just omit the !! or the to_b altogether:

$ ruby20 -e'puts RubyVM::InstructionSequence.compile(%[foo]).disasm'
== disasm: <RubyVM::InstructionSequence:<compiled>@<compiled>>==========
0000 trace            1                                               (   1)
0002 putself          
0003 send             :foo, 0, nil, 24, <ic:0>
0009 leave            

For ruby, it will Just Work to return the object in a method ending in a ?.  There's no need to explicitly convert to a boolean value.
----------------------------------------
Feature #6180: to_b for converting objects to a boolean value
https://bugs.ruby-lang.org/issues/6180#change-24990

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/