Sha256: 03859135cb5a85eeee32f3818e2f10c41264ba283664ab7b6a9065a779ec90df
Contents?: true
Size: 311 Bytes
Versions: 2
Compression:
Stored size: 311 Bytes
Contents
class Fixnum def to_bool return true if self == 1 return false if self == 0 fail "Fixnum '#{self}' can't be converted to Boolean." end end class String def to_bool return true if to_i == 1 return false if to_i == 0 fail "String '#{self}' can't be converted to Boolean." end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
ffi-gdal-1.0.0.beta5 | lib/ext/to_bool.rb |
ffi-gdal-1.0.0.beta4 | lib/ext/to_bool.rb |