Sha256: ad811d2982a37d0ab98cdc8db5168953996467b2117fa5fd70b6170479940246

Contents?: true

Size: 422 Bytes

Versions: 1

Compression:

Stored size: 422 Bytes

Contents

unless String.method_defined? :blank?
  class String
    # Checks whether a string is blank.
    #
    # @return [String] `true` is the string is empty or contains only
    # whitespace, `false` otherwise
    #
    # @example
    #   ''.blank? #=> true
    #
    # @example
    #   '    '.blank? #=> true
    #
    # @example
    #   '  test'.blank? #=> false
    def blank?
      empty? || strip.empty?
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
powerpack-0.0.3 lib/powerpack/string/blank.rb