Sha256: 5c85629c3f43e76f1f148a8ac45b7ee5598b1e1105d41f3331f6d20a23c7dea5
Contents?: true
Size: 381 Bytes
Versions: 23
Compression:
Stored size: 381 Bytes
Contents
class Object def to_b case self when true, false then self when nil then false else to_i != 0 end end end class String TRUE_REGEXP = /^(yes|true|on|t|1|\-1)$/i.freeze FALSE_REGEXP = /^(no|false|off|f|0)$/i.freeze def to_b case self when TRUE_REGEXP then true when FALSE_REGEXP then false else to_i != 0 end end end
Version data entries
23 entries across 23 versions & 1 rubygems