Sha256: 3b5c1a2c6c11b06d34b006c259aa47d27b1499ef2f50746879424179e1e17ca2

Contents?: true

Size: 523 Bytes

Versions: 2

Compression:

Stored size: 523 Bytes

Contents


module Antrapol
  module ToolRack
    module ConditionUtils

      def is_empty?(obj)
        if not defined?(obj)
          true
        elsif obj.nil?
          true
        elsif obj.respond_to?(:empty?)
          if obj.respond_to?(:strip)
            obj.strip.empty?
          else
            obj.empty?
          end
        else
          false
        end
      end # is_empty?

      def not_empty?(obj)
        !is_empty?(obj)
      end # not empty

    end # ConditionUtils
  end # MyToolRack
end # Antrapol

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
toolrack-0.6.0 lib/toolrack/condition_utils.rb
toolrack-0.5.3 lib/toolrack/condition_utils.rb