Sha256: 6df6aa938378c33a0151596a878c39c7db4226e6bd9eaaa43ad765d50a28e349

Contents?: true

Size: 325 Bytes

Versions: 53

Compression:

Stored size: 325 Bytes

Contents

# frozen_string_literal: true

module Worldwide
  class Util
    class << self
      def blank?(value)
        value.nil? ||
          (value.respond_to?(:empty?) && value.empty?) ||
          (value.is_a?(String) && value.strip.empty?)
      end

      def present?(value)
        !blank?(value)
      end
    end
  end
end

Version data entries

53 entries across 53 versions & 1 rubygems

Version Path
worldwide-1.14.1 lib/worldwide/util.rb
worldwide-1.14.0 lib/worldwide/util.rb
worldwide-1.13.0 lib/worldwide/util.rb
worldwide-1.12.0 lib/worldwide/util.rb
worldwide-1.11.1 lib/worldwide/util.rb
worldwide-1.11.0 lib/worldwide/util.rb
worldwide-1.10.0 lib/worldwide/util.rb
worldwide-1.9.0 lib/worldwide/util.rb
worldwide-1.8.0 lib/worldwide/util.rb
worldwide-1.7.5 lib/worldwide/util.rb
worldwide-1.7.4 lib/worldwide/util.rb
worldwide-1.7.3 lib/worldwide/util.rb
worldwide-1.7.2 lib/worldwide/util.rb
worldwide-1.7.1 lib/worldwide/util.rb
worldwide-1.7.0 lib/worldwide/util.rb
worldwide-1.6.2 lib/worldwide/util.rb
worldwide-1.6.1 lib/worldwide/util.rb
worldwide-1.6.0 lib/worldwide/util.rb
worldwide-1.5.0 lib/worldwide/util.rb
worldwide-1.4.1 lib/worldwide/util.rb