Skip to content

Commit

Permalink
Reduce duplication.
Browse files Browse the repository at this point in the history
  • Loading branch information
Gabe Berke-Williams committed Nov 3, 2011
1 parent e4e99f8 commit 76675cb
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions lib/fake_braintree/sinatra_app.rb
Expand Up @@ -7,19 +7,7 @@ class SinatraApp < Sinatra::Base
set :raise_errors, true
disable :logging

helpers do
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
end
include Helpers

# Braintree::Customer.create
post "/merchants/:merchant_id/customers" do
Expand Down

0 comments on commit 76675cb

Please sign in to comment.