Class: Neoon::Client::Connection

Inherits:
Object
  • Object
show all
Includes:
Indexing, Request
Defined in:
lib/neoon/client/connection.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Indexing

#create, #drop, #list

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, connection_options.merge(:builder => middleware))
  @connection.basic_auth(@uri.user, @uri.password) if @uri.user && @uri.password
end

Instance Attribute Details

#connectionObject (readonly)

Returns the value of attribute connection.



5
6
7
# File 'lib/neoon/client/connection.rb', line 5

def connection
  @connection
end