Sha256: 1c74d917ed094b23b006fdbf89541f2a0ab6ee4817fbf5adfc883425a7af71a1
Contents?: true
Size: 729 Bytes
Versions: 89
Compression:
Stored size: 729 Bytes
Contents
# frozen-string-literal: true # # The blank extension adds the blank? method to all objects (e.g. Object#blank?). # # To load the extension: # # Sequel.extension :blank class FalseClass # false is always blank def blank? true end end class Object # Objects are blank if they respond true to empty? def blank? respond_to?(:empty?) && empty? end end class NilClass # nil is always blank def blank? true end end class Numeric # Numerics are never blank (not even 0) def blank? false end end class String # Strings are blank if they are empty or include only whitespace def blank? strip.empty? end end class TrueClass # true is never blank def blank? false end end
Version data entries
89 entries across 79 versions & 2 rubygems