Sha256: d31343d0b4a0de2f7348a8558620fc78b38c20e9a1184b337adfefa4ddbae4b4
Contents?: true
Size: 618 Bytes
Versions: 35
Compression:
Stored size: 618 Bytes
Contents
# blank? parts taken from the active support source # code, used under the MIT License. class Object def blank? respond_to?(:empty?) ? empty? : !self end def present? !blank? 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? self !~ /\S/ end end class Numeric #:nodoc: def blank? false end end
Version data entries
35 entries across 35 versions & 2 rubygems