Sha256: 1ac3d3ce493713f849a11ced1d54d194db759556c36482645d3eaf91f1081e5f
Contents?: true
Size: 514 Bytes
Versions: 17
Compression:
Stored size: 514 Bytes
Contents
# == Synopsis # add a blank? method to all Objects class Object my_extension("blank?") do # return asserted if object is nil or empty def blank? result = nil? unless result if respond_to? 'empty?' if respond_to? 'strip' result = strip.empty? else if respond_to? 'compact' result = compact.empty? else result = empty? end end end end result end end end
Version data entries
17 entries across 17 versions & 4 rubygems