lib/footrest/connection.rb in footrest-0.1.3 vs lib/footrest/connection.rb in footrest-0.2.0
- old
+ new
@@ -5,11 +5,11 @@
module Footrest
module Connection
attr_reader :connection
- def set_connection(config, &block)
+ def set_connection(config)
@connection = Faraday.new(url: config[:prefix]) do |faraday|
faraday.request :multipart
faraday.request :url_encoded
faraday.response :logger if config[:logging]
faraday.adapter Faraday.default_adapter
@@ -17,10 +17,9 @@
faraday.use FaradayMiddleware::ParseJson, :content_type => /\bjson$/
faraday.use Faraday::Response::RaiseFootrestHttpError
faraday.headers[:accept] = "application/json"
faraday.headers[:authorization] = "Bearer #{config[:token]}" if config[:token]
faraday.headers[:user_agent] = "Footrest"
- yield faraday if block_given?
end
end
end
end
\ No newline at end of file