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.4.0 lib/worldwide/util.rb
worldwide-1.3.1 lib/worldwide/util.rb
worldwide-1.3.0 lib/worldwide/util.rb
worldwide-1.2.0 lib/worldwide/util.rb
worldwide-1.1.0 lib/worldwide/util.rb
worldwide-1.0.0 lib/worldwide/util.rb
worldwide-0.15.0 lib/worldwide/util.rb
worldwide-0.14.0 lib/worldwide/util.rb
worldwide-0.11.0 lib/worldwide/util.rb
worldwide-0.10.3 lib/worldwide/util.rb
worldwide-0.10.2 lib/worldwide/util.rb
worldwide-0.10.1 lib/worldwide/util.rb
worldwide-0.10.0 lib/worldwide/util.rb
worldwide-0.9.0 lib/worldwide/util.rb
worldwide-0.8.0 lib/worldwide/util.rb
worldwide-0.7.1 lib/worldwide/util.rb
worldwide-0.7.0 lib/worldwide/util.rb
worldwide-0.6.8 lib/worldwide/util.rb
worldwide-0.6.7 lib/worldwide/util.rb
worldwide-0.6.6 lib/worldwide/util.rb