Sha256: 085ecada3ce0b8fc5803257667b0ffa940b8df8e36aaf12b430151b4716d4107
Contents?: true
Size: 606 Bytes
Versions: 72
Compression:
Stored size: 606 Bytes
Contents
class Object # # Default "integer?" behaviour. # def integer?; false; end # # `truthy?` means `not blank?` # def truthy? if respond_to? :blank? not blank? else not nil? end end end class TrueClass def truthy?; true; end end class FalseClass def truthy?; false; end end class Float # # 'true' if the float is 0.0 # def blank?; self == 0.0; end end class NilClass # # Always 'true'; nil is considered blank. # def blank?; true; end end class Symbol # # Symbols are never blank. # def blank?; false; end end
Version data entries
72 entries across 72 versions & 1 rubygems