lib/deepl/api.rb in deepl-rb-2.5.3 vs lib/deepl/api.rb in deepl-rb-3.0.0

- old
+ new

@@ -1,12 +1,22 @@ +# Copyright 2018 Daniel Herzog +# Use of this source code is governed by an MIT +# license that can be found in the LICENSE.md file. # frozen_string_literal: true module DeepL class API - attr_reader :configuration + attr_reader :configuration, :http_client def initialize(configuration) @configuration = configuration configuration.validate! + uri = URI(configuration.host) + @http_client = Net::HTTP.new(uri.host, uri.port) + @http_client.use_ssl = uri.scheme == 'https' + end + + def update_http_client(client) + @http_client = client end end end