Class: Neoon::Client::Connection
- Inherits:
-
Object
- Object
- Neoon::Client::Connection
- Defined in:
- lib/neoon/client/connection.rb
Instance Attribute Summary collapse
-
#connection ⇒ Object
readonly
Returns the value of attribute connection.
Instance Method Summary collapse
-
#initialize(url) ⇒ Connection
constructor
A new instance of Connection.
Methods included from Indexing
Methods included from Request
#cypher, #delete, #get, #post, #put
Constructor Details
#initialize(url) ⇒ Connection
Returns a new instance of Connection.
7 8 9 10 11 12 |
# File 'lib/neoon/client/connection.rb', line 7 def initialize(url) @uri = URI.parse(url) end_point = "#{@uri.scheme}://#{@uri.host}:#{@uri.port}#{@uri.path}" @connection ||= Faraday.new(end_point, .merge(:builder => middleware)) @connection.basic_auth(@uri.user, @uri.password) if @uri.user && @uri.password end |
Instance Attribute Details
#connection ⇒ Object (readonly)
Returns the value of attribute connection.
5 6 7 |
# File 'lib/neoon/client/connection.rb', line 5 def connection @connection end |