Sha256: a98c5f85f2a660bbbddd54f918ec47c2c3e499f1543cfc230286d0ea01196e65

Contents?: true

Size: 458 Bytes

Versions: 5

Compression:

Stored size: 458 Bytes

Contents

# frozen_string_literal: true

module CodeKindly
  module Utils
    module Presence
      def self.blank?(value)
        # http://apidock.com/rails/Object/blank%3F
        value.respond_to?(:empty?) ? !!value.empty? : !value
      end

      def blank?(value)
        self.class.blank?(value)
      end

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

      def present?(value)
        self.class.present?(value)
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
codekindly-utils-0.0.10 lib/code_kindly/utils/presence.rb
codekindly-utils-0.0.9 lib/code_kindly/utils/presence.rb
codekindly-utils-0.0.8 lib/code_kindly/utils/presence.rb
codekindly-utils-0.0.7 lib/code_kindly/utils/presence.rb
codekindly-utils-0.0.6 lib/code_kindly/utils/presence.rb