Possible duplicates:
Check if the Ruby object is logical.
How can I avoid the truth in Ruby?
For an array like the following (for example):
[3, false, "String", 14, "20-31", true, true, "Other String"]
Is there an easier way to determine which elements are actual Boolean values ββwithout resorting to this, for example?
value === TrueClass || value === FalseClass
Reliance on a position in an array is not an option, as it will vary from case to case.
source
share