Class: Bintray::Client::Ruby::ConnectionFactory
- Inherits:
-
Object
- Object
- Bintray::Client::Ruby::ConnectionFactory
- Defined in:
- lib/bintray/client/ruby/connection_factory.rb
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
- #connect! ⇒ Object
-
#initialize(options = {}) ⇒ ConnectionFactory
constructor
A new instance of ConnectionFactory.
Constructor Details
#initialize(options = {}) ⇒ ConnectionFactory
Returns a new instance of ConnectionFactory.
9 10 11 |
# File 'lib/bintray/client/ruby/connection_factory.rb', line 9 def initialize( = {}) = end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
7 8 9 |
# File 'lib/bintray/client/ruby/connection_factory.rb', line 7 def end |
Instance Method Details
#connect! ⇒ Object
13 14 15 16 17 18 19 20 21 22 |
# File 'lib/bintray/client/ruby/connection_factory.rb', line 13 def connect! Faraday.new() do |conn| conn.use(Faraday::Request::BasicAuthentication, [:username], [:password]) conn.use(Faraday::Request::Multipart) conn.use(Faraday::Request::UrlEncoded) conn.use(Faraday::DetailedLogger::Middleware, [:logger] || default_logger) if [:debug] || [:logger] conn.use(FaradayMiddleware::FollowRedirects, limit: 3) conn.use(Faraday::Adapter::NetHttp) end end |