Sha256: be9c8b12798edf634f9fffb1bb506e6eccb45ed6e419b1d79fe4028f44806c05
Contents?: true
Size: 658 Bytes
Versions: 12
Compression:
Stored size: 658 Bytes
Contents
class Object #:nodoc: # "", " ", nil, [], and {} are blank def blank? if respond_to?(:empty?) && respond_to?(:strip) empty? or strip.empty? elsif respond_to?(:empty?) empty? else !self end end end class NilClass #:nodoc: def blank? true end end class FalseClass #:nodoc: def blank? true end end class TrueClass #:nodoc: def blank? false end end class Array #:nodoc: alias_method :blank?, :empty? end class Hash #:nodoc: alias_method :blank?, :empty? end class String #:nodoc: def blank? empty? || strip.empty? end end class Numeric #:nodoc: def blank? false end end
Version data entries
12 entries across 12 versions & 4 rubygems