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
swiss-crm-activemerchant-1.0.15 lib/active_merchant/empty.rb
swiss-crm-activemerchant-1.0.14 lib/active_merchant/empty.rb
swiss-crm-activemerchant-1.0.13 lib/active_merchant/empty.rb
swiss-crm-activemerchant-1.0.12 lib/active_merchant/empty.rb
swiss-activemerchant-1.0.11 lib/active_merchant/empty.rb
swiss-activemerchant-1.0.10 lib/active_merchant/empty.rb
swiss-activemerchant-1.0.9 lib/active_merchant/empty.rb
swiss-activemerchant-1.0.8 lib/active_merchant/empty.rb
swiss-activemerchant-1.0.7 lib/active_merchant/empty.rb
swiss-activemerchant-1.0.6 lib/active_merchant/empty.rb
swiss-activemerchant-1.0.5 lib/active_merchant/empty.rb
swiss-activemerchant-1.0.4 lib/active_merchant/empty.rb
activemerchant-1.137.0 lib/active_merchant/empty.rb
swiss-activemerchant-1.0.2 lib/active_merchant/empty.rb
swiss-activemerchant-1.0.1 lib/active_merchant/empty.rb
activemerchant-1.133.0 lib/active_merchant/empty.rb
activemerchant-1.131.0 lib/active_merchant/empty.rb
activemerchant-1.130.0 lib/active_merchant/empty.rb
activemerchant-1.129.0 lib/active_merchant/empty.rb
activemerchant-1.126.0 lib/active_merchant/empty.rb