Sha256: d54bc34540d0e8405d859f79acc3d6b19893f6f91ea2329dbd7696f84043fe81

Contents?: true

Size: 299 Bytes

Versions: 114

Compression:

Stored size: 299 Bytes

Contents

module ActiveMerchant
  module Empty
    private

    def empty?(value)
      case value
      when nil
        true
      when Array, Hash
        value.empty?
      when String
        value.strip.empty?
      when Numeric
        (value == 0)
      else
        false
      end
    end
  end
end

Version data entries

114 entries across 113 versions & 8 rubygems

Version Path
activemerchant-1.88.0 lib/active_merchant/empty.rb
activemerchant-1.87.0 lib/active_merchant/empty.rb
activemerchant-1.86.0 lib/active_merchant/empty.rb
activemerchant-1.85.0 lib/active_merchant/empty.rb
activemerchant-1.84.0 lib/active_merchant/empty.rb
activemerchant-1.83.0 lib/active_merchant/empty.rb
activemerchant-1.82.0 lib/active_merchant/empty.rb
activemerchant-1.81.0 lib/active_merchant/empty.rb
activemerchant-1.80.0 lib/active_merchant/empty.rb
activemerchant-1.79.2 lib/active_merchant/empty.rb
activemerchant-1.79.1 lib/active_merchant/empty.rb
activemerchant-1.79.0 lib/active_merchant/empty.rb
activemerchant-1.78.0 lib/active_merchant/empty.rb
activemerchant-1.77.0 lib/active_merchant/empty.rb
activemerchant-1.76.0 lib/active_merchant/empty.rb
activemerchant-1.75.0 lib/active_merchant/empty.rb
activemerchant-1.74.0 lib/active_merchant/empty.rb
activemerchant-1.73.0 lib/active_merchant/empty.rb
activemerchant-1.72.0 lib/active_merchant/empty.rb
activemerchant-1.71.0 lib/active_merchant/empty.rb