Module: MnClient::Connection
- Included in:
- Client
- Defined in:
- lib/mn_client/connection.rb
Instance Method Summary collapse
Instance Method Details
#connection ⇒ Object
9 10 11 12 13 14 15 16 17 |
# File 'lib/mn_client/connection.rb', line 9 def connection @connection ||= Faraday.new(url: "http://localhost:9000") do |faraday| faraday.request :url_encoded faraday.response :logger faraday.use Faraday::Adapter::EMSynchrony # make http request with eventmachine and synchrony faraday.use MnClient::Response::ParseJson # Parse JSON response bodies using MultiJson faraday.use MnClient::Response::RaiseError end end |