lib/neoon/client/connection.rb in neoon-0.0.4 vs lib/neoon/client/connection.rb in neoon-0.0.5
- old
+ new
@@ -3,14 +3,14 @@
class Connection
attr_reader :connection
def initialize(url)
- @uri = URI.parse(url)
- end_point = "#{@uri.scheme}://#{@uri.host}:#{@uri.port}#{@uri.path}"
+ uri = URI.parse(url)
+ end_point = "#{uri.scheme}://#{uri.host}:#{uri.port}#{uri.path}"
@connection ||= Faraday.new(end_point, connection_options.merge(:builder => middleware))
- @connection.basic_auth(@uri.user, @uri.password) if @uri.user && @uri.password
+ @connection.basic_auth(uri.user, uri.password) if uri.user && uri.password
end
include Request
private
@@ -24,10 +24,10 @@
:user_agent => ['Neoon', Neoon::VERSION].join(' ')
},
:request => {
:open_timeout => 5,
:timeout => 10,
- },
+ }
}
end
def middleware
@middleware ||= Faraday::Builder.new do |builder|
\ No newline at end of file