Class: Aptly::Connection
- Inherits:
-
Object
- Object
- Aptly::Connection
- Defined in:
- lib/aptly/connection.rb
Overview
Connection adaptor. This class wraps HTTP interactions for our purposes and adds general purpose automation on top of the raw HTTP actions.
Instance Method Summary collapse
-
#initialize(config: ::Aptly.configuration, query: DEFAULT_QUERY, uri: config.uri) ⇒ Connection
constructor
New connection.
Constructor Details
#initialize(config: ::Aptly.configuration, query: DEFAULT_QUERY, uri: config.uri) ⇒ Connection
New connection.
56 57 58 59 60 61 62 63 64 65 66 67 |
# File 'lib/aptly/connection.rb', line 56 def initialize(config: ::Aptly.configuration, query: DEFAULT_QUERY, uri: config.uri) @query = query @base_uri = uri raise if faraday_uri.nil? @config = config @connection = Faraday.new(faraday_uri) do |c| c.request :multipart c.request :url_encoded c.adapter :excon, @adapter_options end end |