Sha256: 3d04113dbac84c2c179195b0f0f5ab700e68b9e8ea1bc15e3d290fcfb31b1f9a

Contents?: true

Size: 505 Bytes

Versions: 5

Compression:

Stored size: 505 Bytes

Contents

require 'digest/md5'
require 'active_support'
require 'active_support/core_ext'

module FakeBraintree
  module Helpers
    def gzip(content)
      ActiveSupport::Gzip.compress(content)
    end

    def gzipped_response(status_code, uncompressed_content)
      [status_code, { 'Content-Encoding' => 'gzip' }, gzip(uncompressed_content)]
    end

    def md5(content)
      Digest::MD5.hexdigest(content)
    end

    def create_id(merchant_id)
      md5("#{merchant_id}#{Time.now.to_f}")
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
fake_braintree-0.4.3 lib/fake_braintree/helpers.rb
fake_braintree-0.4.2 lib/fake_braintree/helpers.rb
fake_braintree-0.4.1 lib/fake_braintree/helpers.rb
fake_braintree-0.4 lib/fake_braintree/helpers.rb
fake_braintree-0.3 lib/fake_braintree/helpers.rb