Natural coercion into boolean (true / false). Useful for API interaction.
gem "to_bool"
Call to_bool on any object. It will usually return false, except:
- String:
"true","1","yes","ok","enabled","agreed"and"in"are true - Integer:
1is true - TrueClass:
trueis true
See the spec, it pretty much maps it out.
Yes.
MIT