Sha256: ed9e91a55b51d44769f1864f6c54f42fa6017c8495a2dd787176b4d43464bbe3
Contents?: true
Size: 544 Bytes
Versions: 38
Compression:
Stored size: 544 Bytes
Contents
# frozen_string_literal: true # Extensions to the core String class class String unless method_defined? :blank? # Checks whether a string is blank. A string is considered blank if it # is either empty or contains only whitespace characters. # # @return [Boolean] true is the string is blank, false otherwise # # @example # ''.blank? #=> true # # @example # ' '.blank? #=> true # # @example # ' test'.blank? #=> false def blank? empty? || strip.empty? end end end
Version data entries
38 entries across 31 versions & 5 rubygems