Sha256: 7e358b6bb19ba8091149adc9bf7547b7c62871e75513a3ebb9382e48fc08f246
Contents?: true
Size: 476 Bytes
Versions: 10
Compression:
Stored size: 476 Bytes
Contents
# util.rb is inspired by ActiveSupport class Object def blank? respond_to?(:empty?) ? empty? : !self end end class NilClass def blank? true end end class FalseClass def blank? true end end class TrueClass def blank? false end end class Array alias_method :blank?, :empty? end class Hash alias_method :blank?, :empty? end class String def blank? self !~ /[^[:space:]]/ end end class Numeric def blank? false end end
Version data entries
10 entries across 10 versions & 1 rubygems